Commit Graph

22 Commits

Author SHA1 Message Date
Diogo Monica baa92cefa3 Fixed panic on listKeys with invalid keys, added tests
Signed-off-by: David Lawrence <david.lawrence@docker.com>

Signed-off-by: Diogo Monica <diogo@docker.com> (github: endophage)
2015-11-12 01:11:27 -08:00
David Lawrence be4c0669c1 move import/export to cryptoservice and add import to yubikey
Signed-off-by: David Lawrence <david.lawrence@docker.com> (github: endophage)
2015-11-12 01:09:31 -08:00
Ying Li aa5b621968 Fix import error after rebase
Signed-off-by: Ying Li <ying.li@docker.com>
2015-10-28 15:44:33 -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 566bd3ce67 Combine the nonRootKeyStore with the rootKeyStore, and move the abstracting
over the root keys directory from non-root keys directory from keystoremanager
to keystore, since we're eliminating keystoremanager.

Maintain the two separate directories, though, because one can't tell whether
there is an old-style separate-directories structure, or if someone has a GUN
that starts with tuf_keys.

Signed-off-by: Ying Li <ying.li@docker.com>
2015-10-27 12:33:46 -07:00
Nathan McCauley 11af29d8db update tests to check for new types
Signed-off-by: Nathan McCauley <nathan.mccauley@docker.com>
2015-07-23 01:54:14 -07:00
Diogo Monica f7ea67cfab Rebased from master
Signed-off-by: Diogo Monica <diogo@docker.com>
2015-07-20 13:46:01 -07:00
Diogo Monica 4dfe45d64e Changing testify import
Signed-off-by: Diogo Monica <diogo@docker.com>
2015-07-20 13:36:03 -07:00
Diogo Monica 42ded6231c Converted tests to testify and EC generation
Signed-off-by: Diogo Monica <diogo@docker.com>
2015-07-20 13:36:03 -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 1421f47258 keystore caching
Signed-off-by: Nathan McCauley <nathan.mccauley@docker.com>
2015-07-20 13:34:11 -07:00
Diogo Monica f3a7fdf211 Removing doubling of string in test
Signed-off-by: Diogo Monica <diogo@docker.com>
2015-07-20 11:42:10 -07:00
Nathan McCauley f07876602f add test for passphraseRetriever
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
Diogo Mónica 2b7682c323 Merge pull request #82 from docker/new-unit-tests
New unit tests
2015-07-17 18:24:35 -07:00
Aaron Lehmann f5d1a1fbf5 Add test coverage for KeyMemoryStore (and by extension, MemoryFileStore)
Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2015-07-17 16:45:36 -07:00
Diogo Monica 3ec4f1d7f4 Adding RemoveKey and Test
Signed-off-by: Diogo Monica <diogo@docker.com>
2015-07-17 14:31:43 -07:00
Diogo Monica 1ae9cf057e Removing dangling temp test directories 2015-07-09 21:03:54 -07:00
Diogo Monica 4635bed2db Major refactor of keys
Signed-off-by: Diogo Monica <diogo@docker.com>
2015-07-09 17:58:10 -07:00
Diogo Monica d5cdeb93bb Adding EncryptedFileStore and changing interfaces
Signed-off-by: Diogo Monica <diogo@docker.com>
2015-07-05 21:02:16 -07:00
Diogo Monica fd8471038c Added a keyfilestore with encrypted PEM support 2015-07-04 12:17:54 -07:00