diff options
-rw-r--r-- | Data/OpenPGP/Util/DecryptSecretKey.hs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Data/OpenPGP/Util/DecryptSecretKey.hs b/Data/OpenPGP/Util/DecryptSecretKey.hs index 753cef3..219b520 100644 --- a/Data/OpenPGP/Util/DecryptSecretKey.hs +++ b/Data/OpenPGP/Util/DecryptSecretKey.hs | |||
@@ -73,10 +73,10 @@ decryptSecretKey :: | |||
73 | decryptSecretKey _ k@(OpenPGP.SecretKeyPacket { OpenPGP.symmetric_algorithm = OpenPGP.Unencrypted }) | 73 | decryptSecretKey _ k@(OpenPGP.SecretKeyPacket { OpenPGP.symmetric_algorithm = OpenPGP.Unencrypted }) |
74 | = Just k | 74 | = Just k |
75 | decryptSecretKey pass k@(OpenPGP.SecretKeyPacket { | 75 | decryptSecretKey pass k@(OpenPGP.SecretKeyPacket { |
76 | OpenPGP.version = 4, OpenPGP.key_algorithm = kalgo, | 76 | OpenPGP.version = v, OpenPGP.key_algorithm = kalgo, |
77 | OpenPGP.s2k = s2k, OpenPGP.symmetric_algorithm = salgo, | 77 | OpenPGP.s2k = s2k, OpenPGP.symmetric_algorithm = salgo, |
78 | OpenPGP.key = existing, OpenPGP.encrypted_data = encd | 78 | OpenPGP.key = existing, OpenPGP.encrypted_data = encd |
79 | }) | chkF material == LZ.toStrict chk = -- TODO: v5 | 79 | }) | chkF material == LZ.toStrict chk && (v==4 || v==5) = |
80 | fmap (\m -> k { | 80 | fmap (\m -> k { |
81 | OpenPGP.s2k_useage = 0, | 81 | OpenPGP.s2k_useage = 0, |
82 | OpenPGP.symmetric_algorithm = OpenPGP.Unencrypted, | 82 | OpenPGP.symmetric_algorithm = OpenPGP.Unencrypted, |