summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjoe <joe@jerkface.net>2013-10-30 23:07:08 -0400
committerjoe <joe@jerkface.net>2013-10-30 23:07:08 -0400
commit0e478f8505d60ecaeefe55e23e2d8e824e44b9bd (patch)
tree39beb04a376752c796167ff6cf6dd671278d7f67
parent0b65ae400ee5f2d04b188c618a5927aa7113d9be (diff)
Support unencrypted keys for 'add' method.
-rw-r--r--keys.hs10
1 files changed, 6 insertions, 4 deletions
diff --git a/keys.hs b/keys.hs
index c36a01e..7553ea3 100644
--- a/keys.hs
+++ b/keys.hs
@@ -1027,10 +1027,12 @@ main = do
1027 flip (maybe (error "No working key?")) grip $ \grip -> do 1027 flip (maybe (error "No working key?")) grip $ \grip -> do
1028 1028
1029 let (pre, wk:subs) = seek_key grip sec 1029 let (pre, wk:subs) = seek_key grip sec
1030 wkun = do 1030 wkun = if symmetric_algorithm wk == Unencrypted
1031 k <- decryptSecretKey pw wk 1031 then Just wk
1032 guard (symmetric_algorithm k == Unencrypted) 1032 else do
1033 return k 1033 k <- decryptSecretKey pw wk
1034 guard (symmetric_algorithm k == Unencrypted)
1035 return k
1034 1036
1035 flip (maybe (error "Bad passphrase?")) wkun$ \wkun -> do 1037 flip (maybe (error "Bad passphrase?")) wkun$ \wkun -> do
1036 1038