Skip to content

Commit

Permalink
Delete old crypto code move v2 inplace
Browse files Browse the repository at this point in the history
This moves the new TRC, Cert v2 code into the place of the old code.
Also moves v2 in the scion-pki to the parent folder.

This PR deletes cryptosyncer of the PS and custpk-load tool, because they used the old API.
Those removed processes have to be rewritten against the new version of the code.
  • Loading branch information
lukedirtwalker committed Jan 9, 2020
1 parent 1716c4f commit 3c68688
Show file tree
Hide file tree
Showing 307 changed files with 1,893 additions and 12,515 deletions.
2 changes: 0 additions & 2 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ pkg_tar(
"//go/godispatcher:godispatcher",
"//go/tools/logdog:logdog",
"//go/path_srv:path_srv",
"//go/tools/scion-custpk-load:scion-custpk-load",
"//go/sciond:sciond",
"//go/tools/scion-pki:scion-pki",
"//go/tools/scmp:scmp",
Expand Down Expand Up @@ -55,7 +54,6 @@ pkg_tar(
name = "scion-topo",
package_dir = "",
srcs = [
"//go/tools/scion-custpk-load:scion-custpk-load",
"//go/tools/scion-pki:scion-pki",
],
mode = "0755",
Expand Down
2 changes: 1 addition & 1 deletion go/beacon_srv/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ go_library(
"//go/lib/infra/messenger:go_default_library",
"//go/lib/infra/modules/idiscovery:go_default_library",
"//go/lib/infra/modules/itopo:go_default_library",
"//go/lib/infra/modules/trust/v2:go_default_library",
"//go/lib/infra/modules/trust:go_default_library",
"//go/lib/keyconf:go_default_library",
"//go/lib/log:go_default_library",
"//go/lib/periodic:go_default_library",
Expand Down
2 changes: 1 addition & 1 deletion go/beacon_srv/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ import (
"github.com/scionproto/scion/go/lib/infra/messenger"
"github.com/scionproto/scion/go/lib/infra/modules/idiscovery"
"github.com/scionproto/scion/go/lib/infra/modules/itopo"
"github.com/scionproto/scion/go/lib/infra/modules/trust/v2"
"github.com/scionproto/scion/go/lib/infra/modules/trust"
"github.com/scionproto/scion/go/lib/keyconf"
"github.com/scionproto/scion/go/lib/log"
"github.com/scionproto/scion/go/lib/periodic"
Expand Down
2 changes: 1 addition & 1 deletion go/cert_srv/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ go_library(
"//go/lib/infra/messenger:go_default_library",
"//go/lib/infra/modules/idiscovery:go_default_library",
"//go/lib/infra/modules/itopo:go_default_library",
"//go/lib/infra/modules/trust/v2:go_default_library",
"//go/lib/infra/modules/trust:go_default_library",
"//go/lib/keyconf:go_default_library",
"//go/lib/log:go_default_library",
"//go/lib/periodic:go_default_library",
Expand Down
1 change: 0 additions & 1 deletion go/cert_srv/internal/config/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ go_library(
"//go/lib/config:go_default_library",
"//go/lib/env:go_default_library",
"//go/lib/infra/modules/idiscovery:go_default_library",
"//go/lib/scrypto/cert:go_default_library",
"//go/lib/serrors:go_default_library",
"//go/lib/truststorage:go_default_library",
"//go/lib/util:go_default_library",
Expand Down
3 changes: 1 addition & 2 deletions go/cert_srv/internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import (
"github.com/scionproto/scion/go/lib/config"
"github.com/scionproto/scion/go/lib/env"
"github.com/scionproto/scion/go/lib/infra/modules/idiscovery"
"github.com/scionproto/scion/go/lib/scrypto/cert"
"github.com/scionproto/scion/go/lib/serrors"
"github.com/scionproto/scion/go/lib/truststorage"
"github.com/scionproto/scion/go/lib/util"
Expand All @@ -34,7 +33,7 @@ const (
LeafReissTime = 6 * time.Hour
// IssuerReissTime is the default value for CSConf.IssuerReissTime. It is larger
// than the leaf certificate validity period in order to provide optimal coverage.
IssuerReissTime = 1*time.Hour + cert.DefaultLeafCertValidity*time.Second
IssuerReissTime = (3*24 + 1) * time.Hour
// ReissReqRate is the default interval between two consecutive reissue requests.
ReissReqRate = 10 * time.Second
// ReissueReqTimeout is the default timeout of a reissue request.
Expand Down
2 changes: 1 addition & 1 deletion go/cert_srv/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import (
"github.com/scionproto/scion/go/lib/infra/messenger"
"github.com/scionproto/scion/go/lib/infra/modules/idiscovery"
"github.com/scionproto/scion/go/lib/infra/modules/itopo"
"github.com/scionproto/scion/go/lib/infra/modules/trust/v2"
"github.com/scionproto/scion/go/lib/infra/modules/trust"
"github.com/scionproto/scion/go/lib/keyconf"
"github.com/scionproto/scion/go/lib/log"
"github.com/scionproto/scion/go/lib/periodic"
Expand Down
4 changes: 2 additions & 2 deletions go/integration/cert_req/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ go_library(
"//go/lib/log:go_default_library",
"//go/lib/sciond:go_default_library",
"//go/lib/scrypto:go_default_library",
"//go/lib/scrypto/cert/v2:go_default_library",
"//go/lib/scrypto/trc/v2:go_default_library",
"//go/lib/scrypto/cert:go_default_library",
"//go/lib/scrypto/trc:go_default_library",
"//go/lib/snet:go_default_library",
"//go/lib/tracing:go_default_library",
],
Expand Down
4 changes: 2 additions & 2 deletions go/integration/cert_req/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ import (
"github.com/scionproto/scion/go/lib/log"
"github.com/scionproto/scion/go/lib/sciond"
"github.com/scionproto/scion/go/lib/scrypto"
"github.com/scionproto/scion/go/lib/scrypto/cert/v2"
"github.com/scionproto/scion/go/lib/scrypto/trc/v2"
"github.com/scionproto/scion/go/lib/scrypto/cert"
"github.com/scionproto/scion/go/lib/scrypto/trc"
"github.com/scionproto/scion/go/lib/snet"
"github.com/scionproto/scion/go/lib/tracing"
)
Expand Down
4 changes: 1 addition & 3 deletions go/lib/ctrl/cert_mgmt/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,8 @@ go_library(
"//go/lib/common:go_default_library",
"//go/lib/scrypto:go_default_library",
"//go/lib/scrypto/cert:go_default_library",
"//go/lib/scrypto/cert/v2:go_default_library",
"//go/lib/scrypto/cert/v2/renewal:go_default_library",
"//go/lib/scrypto/cert/renewal:go_default_library",
"//go/lib/scrypto/trc:go_default_library",
"//go/lib/scrypto/trc/v2:go_default_library",
"//go/proto:go_default_library",
],
)
10 changes: 1 addition & 9 deletions go/lib/ctrl/cert_mgmt/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ package cert_mgmt
import (
"fmt"

legacy "github.com/scionproto/scion/go/lib/scrypto/cert"
"github.com/scionproto/scion/go/lib/scrypto/cert/v2"
"github.com/scionproto/scion/go/lib/scrypto/cert"
"github.com/scionproto/scion/go/proto"
)

Expand All @@ -29,13 +28,6 @@ type Chain struct {
RawChain []byte `capnp:"chain"`
}

func (c *Chain) Chain() (*legacy.Chain, error) {
if c.RawChain == nil {
return nil, nil
}
return legacy.ChainFromRaw(c.RawChain, true)
}

func (c *Chain) ProtoId() proto.ProtoIdType {
return proto.CertChain_TypeID
}
Expand Down
2 changes: 1 addition & 1 deletion go/lib/ctrl/cert_mgmt/chain_iss_rep.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ package cert_mgmt
import (
"fmt"

"github.com/scionproto/scion/go/lib/scrypto/cert/v2"
"github.com/scionproto/scion/go/lib/scrypto/cert"
"github.com/scionproto/scion/go/proto"
)

Expand Down
2 changes: 1 addition & 1 deletion go/lib/ctrl/cert_mgmt/chain_iss_req.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ package cert_mgmt
import (
"fmt"

"github.com/scionproto/scion/go/lib/scrypto/cert/v2/renewal"
"github.com/scionproto/scion/go/lib/scrypto/cert/renewal"
"github.com/scionproto/scion/go/proto"
)

Expand Down
10 changes: 1 addition & 9 deletions go/lib/ctrl/cert_mgmt/trc.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ package cert_mgmt
import (
"fmt"

legacy "github.com/scionproto/scion/go/lib/scrypto/trc"
"github.com/scionproto/scion/go/lib/scrypto/trc/v2"
"github.com/scionproto/scion/go/lib/scrypto/trc"
"github.com/scionproto/scion/go/proto"
)

Expand All @@ -29,13 +28,6 @@ type TRC struct {
RawTRC []byte `capnp:"trc"`
}

func (t *TRC) TRC() (*legacy.TRC, error) {
if t.RawTRC == nil {
return nil, nil
}
return legacy.TRCFromRaw(t.RawTRC, true)
}

func (t *TRC) ProtoId() proto.ProtoIdType {
return proto.TRC_TypeID
}
Expand Down
49 changes: 34 additions & 15 deletions go/lib/infra/modules/trust/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,20 @@ go_library(
name = "go_default_library",
srcs = [
"config.go",
"db.go",
"handlers.go",
"helpers.go",
"inserter.go",
"inspector.go",
"provider.go",
"recurser.go",
"resolver.go",
"resolvers.go",
"router.go",
"rpc.go",
"signer.go",
"signhelper.go",
"trust.go",
"store.go",
"verifier.go",
],
importpath = "github.com/scionproto/scion/go/lib/infra/modules/trust",
visibility = ["//visibility:public"],
Expand All @@ -20,51 +29,61 @@ go_library(
"//go/lib/infra:go_default_library",
"//go/lib/infra/dedupe:go_default_library",
"//go/lib/infra/messenger:go_default_library",
"//go/lib/infra/modules/trust/internal/metrics:go_default_library",
"//go/lib/infra/modules/trust/trustdb:go_default_library",
"//go/lib/infra/modules/db:go_default_library",
"//go/lib/infra/modules/trust/internal/decoded:go_default_library",
"//go/lib/keyconf:go_default_library",
"//go/lib/log:go_default_library",
"//go/lib/scrypto:go_default_library",
"//go/lib/scrypto/cert:go_default_library",
"//go/lib/scrypto/trc:go_default_library",
"//go/lib/serrors:go_default_library",
"//go/lib/snet:go_default_library",
"//go/lib/topology:go_default_library",
"//go/lib/util:go_default_library",
"//go/proto:go_default_library",
"@com_github_opentracing_opentracing_go//:go_default_library",
"@com_github_opentracing_opentracing_go//ext:go_default_library",
],
)

go_test(
name = "go_default_test",
srcs = [
"signhelper_test.go",
"trust_test.go",
"handlers_test.go",
"inserter_test.go",
"inspector_test.go",
"main_test.go",
"provider_test.go",
"recurser_test.go",
"resolver_test.go",
"router_test.go",
"signer_test.go",
"verifier_export_test.go",
"verifier_test.go",
],
data = [
"//go/lib/infra/modules/trust/testdata:data",
"//go/lib/infra/modules/trust/testdata:crypto_tar",
],
],
embed = [":go_default_library"],
deps = [
"//go/lib/addr:go_default_library",
"//go/lib/common:go_default_library",
"//go/lib/ctrl:go_default_library",
"//go/lib/ctrl/cert_mgmt:go_default_library",
"//go/lib/infra:go_default_library",
"//go/lib/infra/disp:go_default_library",
"//go/lib/infra/messenger:go_default_library",
"//go/lib/infra/mock_infra:go_default_library",
"//go/lib/infra/modules/itopo/itopotest:go_default_library",
"//go/lib/infra/modules/trust/trustdb/trustdbsqlite:go_default_library",
"//go/lib/infra/modules/trust/internal/decoded:go_default_library",
"//go/lib/infra/modules/trust/mock_trust:go_default_library",
"//go/lib/keyconf:go_default_library",
"//go/lib/log:go_default_library",
"//go/lib/scrypto:go_default_library",
"//go/lib/scrypto/cert:go_default_library",
"//go/lib/scrypto/trc:go_default_library",
"//go/lib/serrors:go_default_library",
"//go/lib/snet:go_default_library",
"//go/lib/topology:go_default_library",
"//go/lib/snet/mock_snet:go_default_library",
"//go/lib/spath:go_default_library",
"//go/lib/util:go_default_library",
"//go/lib/xtest:go_default_library",
"//go/lib/xtest/p2p:go_default_library",
"//go/proto:go_default_library",
"@com_github_golang_mock//gomock:go_default_library",
"@com_github_stretchr_testify//assert:go_default_library",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ import (

"github.com/scionproto/scion/go/lib/addr"
"github.com/scionproto/scion/go/lib/infra/modules/db"
"github.com/scionproto/scion/go/lib/infra/modules/trust/v2/internal/decoded"
"github.com/scionproto/scion/go/lib/infra/modules/trust/internal/decoded"
"github.com/scionproto/scion/go/lib/scrypto"
"github.com/scionproto/scion/go/lib/scrypto/trc/v2"
"github.com/scionproto/scion/go/lib/scrypto/trc"
"github.com/scionproto/scion/go/lib/serrors"
)

Expand Down
Loading

0 comments on commit 3c68688

Please sign in to comment.