Browse code

update vendor.sh and notary api for vendored changes

Signed-off-by: Jessica Frazelle <acidburn@docker.com>

Jessica Frazelle authored on 2015/10/31 09:37:08
Showing 3 changed files
... ...
@@ -28,9 +28,9 @@ import (
28 28
 	"github.com/docker/docker/pkg/tlsconfig"
29 29
 	"github.com/docker/docker/registry"
30 30
 	"github.com/docker/notary/client"
31
-	"github.com/docker/notary/pkg/passphrase"
31
+	"github.com/docker/notary/passphrase"
32 32
 	"github.com/docker/notary/trustmanager"
33
-	"github.com/endophage/gotuf/data"
33
+	"github.com/docker/notary/tuf/data"
34 34
 )
35 35
 
36 36
 var untrusted bool
... ...
@@ -342,22 +342,6 @@ func (cli *DockerCli) trustedPull(repoInfo *registry.RepositoryInfo, ref registr
342 342
 	return nil
343 343
 }
344 344
 
345
-func selectKey(keys map[string]string) string {
346
-	if len(keys) == 0 {
347
-		return ""
348
-	}
349
-
350
-	keyIDs := []string{}
351
-	for k := range keys {
352
-		keyIDs = append(keyIDs, k)
353
-	}
354
-
355
-	// TODO(dmcgowan): let user choose if multiple keys, now pick consistently
356
-	sort.Strings(keyIDs)
357
-
358
-	return keyIDs[0]
359
-}
360
-
361 345
 func targetStream(in io.Writer) (io.WriteCloser, <-chan []target) {
362 346
 	r, w := io.Pipe()
363 347
 	out := io.MultiWriter(in, w)
... ...
@@ -454,23 +438,22 @@ func (cli *DockerCli) trustedPush(repoInfo *registry.RepositoryInfo, tag string,
454 454
 		return notaryError(err)
455 455
 	}
456 456
 
457
-	ks := repo.KeyStoreManager
458
-	keys := ks.RootKeyStore().ListKeys()
457
+	keys := repo.CryptoService.ListKeys(data.CanonicalRootRole)
459 458
 
460
-	rootKey := selectKey(keys)
461
-	if rootKey == "" {
462
-		rootKey, err = ks.GenRootKey("ecdsa")
459
+	var rootKeyID string
460
+	// always select the first root key
461
+	if len(keys) > 0 {
462
+		sort.Strings(keys)
463
+		rootKeyID = keys[0]
464
+	} else {
465
+		rootPublicKey, err := repo.CryptoService.Create(data.CanonicalRootRole, data.ECDSAKey)
463 466
 		if err != nil {
464 467
 			return err
465 468
 		}
469
+		rootKeyID = rootPublicKey.ID()
466 470
 	}
467 471
 
468
-	cryptoService, err := ks.GetRootCryptoService(rootKey)
469
-	if err != nil {
470
-		return err
471
-	}
472
-
473
-	if err := repo.Initialize(cryptoService); err != nil {
472
+	if err := repo.Initialize(rootKeyID); err != nil {
474 473
 		return notaryError(err)
475 474
 	}
476 475
 	fmt.Fprintf(cli.out, "Finished initializing %q\n", repoInfo.CanonicalName)
... ...
@@ -76,12 +76,16 @@ clean() {
76 76
 	local buildTagCombos=(
77 77
 		''
78 78
 		'experimental'
79
+		'pkcs11'
79 80
 		"$dockerBuildTags"
80 81
 		"daemon $dockerBuildTags"
81 82
 		"daemon cgo $dockerBuildTags"
82 83
 		"experimental $dockerBuildTags"
83 84
 		"experimental daemon $dockerBuildTags"
84 85
 		"experimental daemon cgo $dockerBuildTags"
86
+		"pkcs11 $dockerBuildTags"
87
+		"pkcs11 daemon $dockerBuildTags"
88
+		"pkcs11 daemon cgo $dockerBuildTags"
85 89
 	)
86 90
 
87 91
 	echo
... ...
@@ -19,7 +19,7 @@ clone git github.com/microsoft/hcsshim de43b42b5ce14dfdcbeedb0628b0032174d89caa
19 19
 clone git github.com/mistifyio/go-zfs v2.1.1
20 20
 clone git github.com/tchap/go-patricia v2.1.0
21 21
 clone git github.com/vdemeester/shakers 3c10293ce22b900c27acad7b28656196fcc2f73b
22
-clone git golang.org/x/net 3cffabab72adf04f8e3b01c5baf775361837b5fe https://github.com/golang/net.git
22
+clone git golang.org/x/net 47990a1ba55743e6ef1affd3a14e5bac8553615d https://github.com/golang/net.git
23 23
 
24 24
 #get libnetwork packages
25 25
 clone git github.com/docker/libnetwork e8ebc0bf6510343c88d162db08b3d855cbbe75b9
... ...
@@ -43,8 +43,9 @@ clone git github.com/boltdb/bolt v1.1.0
43 43
 clone git github.com/docker/distribution c6c9194e9c6097f84b0ff468a741086ff7704aa3
44 44
 clone git github.com/vbatts/tar-split v0.9.10
45 45
 
46
-clone git github.com/docker/notary 089d8450d8928aa1c58fd03f09cabbde9bcb4590
47
-clone git github.com/endophage/gotuf 2df1c8e0a7b7e10ae2113bf37aaa1bf1c1de8cc5
46
+clone git github.com/docker/notary 45de2828b5e0083bfb4e9a5a781eddb05e2ef9d0
47
+clone git google.golang.org/grpc 174192fc93efcb188fc8f46ca447f0da606b6885 https://github.com/grpc/grpc-go.git
48
+clone git github.com/miekg/pkcs11 80f102b5cac759de406949c47f0928b99bd64cdf
48 49
 clone git github.com/jfrazelle/go v1.5.1-1
49 50
 clone git github.com/agl/ed25519 d2b94fd789ea21d12fac1a4443dd3a3f79cda72c
50 51