diff options
author | joe <joe@jerkface.net> | 2013-10-30 23:07:08 -0400 |
---|---|---|
committer | joe <joe@jerkface.net> | 2013-10-30 23:07:08 -0400 |
commit | 0e478f8505d60ecaeefe55e23e2d8e824e44b9bd (patch) | |
tree | 39beb04a376752c796167ff6cf6dd671278d7f67 | |
parent | 0b65ae400ee5f2d04b188c618a5927aa7113d9be (diff) |
Support unencrypted keys for 'add' method.
-rw-r--r-- | keys.hs | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -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 | ||