Skip to content

Commit 8feeaec

Browse files
committed
use ad-hoc libtrust key
This is only used for tests, and the key is not verified anymore, so instead of creating a key and storing it, we can just use an ad-hoc one. Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent e854b2a commit 8feeaec

7 files changed

Lines changed: 0 additions & 92 deletions

File tree

cmd/dockerd/options.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,6 @@ func (o *daemonOptions) installFlags(flags *pflag.FlagSet) {
6565
flags.BoolVar(&o.TLS, FlagTLS, DefaultTLSValue, "Use TLS; implied by --tlsverify")
6666
flags.BoolVar(&o.TLSVerify, FlagTLSVerify, dockerTLSVerify || DefaultTLSValue, "Use TLS and verify the remote")
6767

68-
// TODO use flag flags.String("identity"}, "i", "", "Path to libtrust key file")
69-
7068
o.TLSOptions = &tlsconfig.Options{}
7169
tlsOptions := o.TLSOptions
7270
flags.StringVar(&tlsOptions.CAFile, "tlscacert", filepath.Join(dockerCertPath, DefaultCaFile), "Trust certs signed only by this CA")

daemon/daemon.go

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1058,19 +1058,6 @@ func NewDaemon(ctx context.Context, config *config.Config, pluginStore *plugin.S
10581058
ContentNamespace: config.ContainerdNamespace,
10591059
}
10601060

1061-
// This is a temporary environment variables used in CI to allow pushing
1062-
// manifest v2 schema 1 images to test-registries used for testing *pulling*
1063-
// these images.
1064-
if os.Getenv("DOCKER_ALLOW_SCHEMA1_PUSH_DONOTUSE") != "" {
1065-
// Previously, this was stored in the daemon's config-directory, but
1066-
// as pushing V1 is deprecated, and we only need this file during
1067-
// our integration tests, just store it within the "trust" directory.
1068-
imgSvcConfig.TrustKey, err = loadOrCreateTrustKey(filepath.Join(config.Root, "trust", "key.json"))
1069-
if err != nil {
1070-
return nil, err
1071-
}
1072-
}
1073-
10741061
// containerd is not currently supported with Windows.
10751062
// So sometimes d.containerdCli will be nil
10761063
// In that case we'll create a local content store... but otherwise we'll use containerd

daemon/images/image_push.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ func (i *ImageService) PushImage(ctx context.Context, image, tag string, metaHea
5454
},
5555
ConfigMediaType: schema2.MediaTypeImageConfig,
5656
LayerStores: distribution.NewLayerProvidersFromStore(i.layerStore),
57-
TrustKey: i.trustKey,
5857
UploadManager: i.uploadManager,
5958
}
6059

daemon/images/service.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import (
1616
"github.com/docker/docker/layer"
1717
dockerreference "github.com/docker/docker/reference"
1818
"github.com/docker/docker/registry"
19-
"github.com/docker/libtrust"
2019
"github.com/opencontainers/go-digest"
2120
"github.com/pkg/errors"
2221
"golang.org/x/sync/singleflight"
@@ -44,7 +43,6 @@ type ImageServiceConfig struct {
4443
MaxDownloadAttempts int
4544
ReferenceStore dockerreference.Store
4645
RegistryService registry.Service
47-
TrustKey libtrust.PrivateKey
4846
ContentStore content.Store
4947
Leases leases.Manager
5048
ContentNamespace string
@@ -61,7 +59,6 @@ func NewImageService(config ImageServiceConfig) *ImageService {
6159
layerStore: config.LayerStore,
6260
referenceStore: config.ReferenceStore,
6361
registryService: config.RegistryService,
64-
trustKey: config.TrustKey,
6562
uploadManager: xfer.NewLayerUploadManager(config.MaxConcurrentUploads),
6663
leases: config.Leases,
6764
content: config.ContentStore,
@@ -80,7 +77,6 @@ type ImageService struct {
8077
pruneRunning int32
8178
referenceStore dockerreference.Store
8279
registryService registry.Service
83-
trustKey libtrust.PrivateKey
8480
uploadManager *xfer.LayerUploadManager
8581
leases leases.Manager
8682
content content.Store

daemon/trustkey.go

Lines changed: 0 additions & 9 deletions
This file was deleted.

daemon/trustkey_test.go

Lines changed: 0 additions & 59 deletions
This file was deleted.

distribution/config.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import (
1717
"github.com/docker/docker/pkg/system"
1818
refstore "github.com/docker/docker/reference"
1919
registrypkg "github.com/docker/docker/registry"
20-
"github.com/docker/libtrust"
2120
"github.com/opencontainers/go-digest"
2221
specs "github.com/opencontainers/image-spec/specs-go/v1"
2322
"github.com/pkg/errors"
@@ -74,9 +73,6 @@ type ImagePushConfig struct {
7473
ConfigMediaType string
7574
// LayerStores manages layers.
7675
LayerStores PushLayerProvider
77-
// TrustKey is the private key for legacy signatures. This is typically
78-
// an ephemeral key, since these signatures are no longer verified.
79-
TrustKey libtrust.PrivateKey
8076
// UploadManager dispatches uploads.
8177
UploadManager *xfer.LayerUploadManager
8278
}

0 commit comments

Comments
 (0)