Commit Graph

19 Commits

Author SHA1 Message Date
Miloslav Trmač c2d560c789 Remove a left-over debugging Println
Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2015-10-30 20:38:41 +01:00
Ying Li b9a4175ea9 Update the client NotaryRepository to initialize with a root key ID
Signed-off-by: Ying Li <ying.li@docker.com>
2015-10-29 15:11:15 -07:00
David Lawrence f73560d839 creating concrete types for the various key ciphers
Signed-off-by: David Lawrence <david.lawrence@docker.com> (github: endophage)
2015-10-28 16:02:55 -07:00
David Lawrence daa36b43b7 Merge pull request #242 from docker/unify-root-nonroot-keystore
Unify root nonroot keystore
2015-10-28 13:14:19 -07:00
David Lawrence 2833a88292 adding gotuf to notary
Signed-off-by: David Lawrence <david.lawrence@docker.com> (github: endophage)
2015-10-27 16:36:06 -07:00
Ying Li 75b63b84cd Add import/export to KeyStore interface so that the import_export code
makes use of this rather than mangle files manually to import/export
root keys.  (Regular keys it just zips up the whole directory.)

Signed-off-by: Ying Li <ying.li@docker.com>
2015-10-27 16:19:14 -07:00
Ying Li d5bbaae9c9 Remove symlinking and symlink checking from key import-export.
Signed-off-by: Ying Li <ying.li@docker.com>
2015-10-23 21:07:37 -07:00
Aaron Lehmann ec3167eedb Import and export symlinks in keystore
- Export symlinks by encoding them in the zip file.

- Detect symlinks in a zip file on import and create them on the local
  filesystem.

- Add test coverage.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2015-08-03 15:03:31 -07:00
Diogo Monica a23bac9130 Fix gofmt
Signed-off-by: Diogo Monica <diogo@docker.com>
2015-07-28 18:25:37 -07:00
Diogo Monica 27461ad9fb Added cli cert command, changed keylisting to be a map, fixed key removal
Signed-off-by: Diogo Monica <diogo@docker.com>
2015-07-28 18:14:29 -07:00
Aaron Lehmann c3cf6c4083 Add a flag to change the password of the root key when exporting it
Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2015-07-28 15:08:41 -07:00
Aaron Lehmann 1aced67471 Improvements to keystore caching
* RemoveKey must purge the cache entry

* Add mutexes to KeyFileStore and KeyMemoryStore so the cachedKeys map
  is protected in the case that keystore operations happen from multiple
  goroutines

* Change GetKey to return the alias along with the key. Remove
  GetKeyAlias. This simplifies the code flows that retrieve the alias
  (since they usually get the key and alias together).

* Fix tests affected by key caching

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2015-07-20 13:36:03 -07:00
Nathan McCauley 0642da80f1 review feedback
Signed-off-by: Nathan McCauley <nathan.mccauley@docker.com>
2015-07-20 11:00:24 -07:00
Nathan McCauley 38fe6bd45b gofmt across the baord
Signed-off-by: Nathan McCauley <nathan.mccauley@docker.com>
2015-07-20 11:00:24 -07:00
Nathan McCauley de6f65b7e7 many testing fixups to support key aliasing
Signed-off-by: Nathan McCauley <nathan.mccauley@docker.com>
2015-07-20 11:00:22 -07:00
Aaron Lehmann e5a42d4df9 Add ExportKeysByGUN function
It exports the keys for a particular GUN to a zip, encrypted with a
specified passphrase.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2015-07-15 17:14:57 -07:00
Aaron Lehmann 0ffb2c69d9 Add a check that a root key being imported is encrypted
Add unit test coverage that makes this check fail. Also add unit test
coverage for making sure trying to import something that isn't PEM fails
in the expected way.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2015-07-15 17:14:56 -07:00
Aaron Lehmann 479333ca7b Add ExportRootKey and ImportRootKey functions
Also add a unit test

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2015-07-15 17:14:56 -07:00
Aaron Lehmann eb8a7a0e25 Add ImportKeysZip and test coverage
This function reads a zip file and populates the keystores with the keys
in the zip file. Root keys are left encrypted, and non-root keys are
decrypted before being added to the keystore.

The unit test first exports a repo's keys to a zip file, then imports it
into another repo. It checks that all the correct keys exist in the new
repo after the import operation.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2015-07-15 17:14:56 -07:00