From f17abaa8ec3654ab4973641e2f551fe5b7088671 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 6 Oct 2016 15:37:12 -0400 Subject: Gpg keyid bugs Fix bugs with entry of gpg keyid in the keysafe.log. Gpg.anyKey was being used in writing the log, which made the log contain gpg keys with an empty keyid. Fix bug in --autostart that caused the full gpg keyid to be used in the name, so restores would only work when --gpgkeyid was specifid. Added a Distinguisher data type rather than the Gpg.anyKey hack. This commit was sponsored by Thom May on Patreon. --- Tests.hs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'Tests.hs') diff --git a/Tests.hs b/Tests.hs index 7294cfb..bbc9dcd 100644 --- a/Tests.hs +++ b/Tests.hs @@ -91,12 +91,12 @@ backupRestoreTest testdesc secretkey = kek <- genKeyEncryptionKey tunables name password let esk = encrypt tunables kek secretkey shares <- genShares esk tunables - let sis = shareIdents tunables name secretkeysource + let sis = shareIdents tunables name AnyGpgKey _ <- storeShares storagelocations sis shares (return ()) return () restore storagelocations = do - let sis = shareIdents tunables name secretkeysource + let sis = shareIdents tunables name AnyGpgKey (shares, sis', _) <- retrieveShares storagelocations sis (return ()) let candidatekeys = candidateKeyEncryptionKeys tunables name password case combineShares tunables [shares] of @@ -120,7 +120,6 @@ backupRestoreTest testdesc secretkey = name = Name testdesc password = Password "password" - secretkeysource = GpgKey (KeyId "dummy") -- testModeTunables is used, to avoid this taking a very -- long time to run. tunables = testModeTunables @@ -132,7 +131,7 @@ stableNamingTest testdesc = (testdesc, runtest $ map snd knownTunings) where runtest [] = testFailed "not stable!" runtest (tunables:rest) = do - let sis = shareIdents tunables name secretkeysource + let sis = shareIdents tunables name (Distinguisher secretkeysource) if S.member knownvalue (head (identsStream sis)) then testSuccess else runtest rest -- cgit v1.2.3