diff options
-rw-r--r-- | Data/OpenPGP.hs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Data/OpenPGP.hs b/Data/OpenPGP.hs index 5e62d1a..266cd9b 100644 --- a/Data/OpenPGP.hs +++ b/Data/OpenPGP.hs | |||
@@ -68,7 +68,6 @@ import Control.Applicative | |||
68 | import Data.Bits | 68 | import Data.Bits |
69 | import Data.Word | 69 | import Data.Word |
70 | import Data.Char | 70 | import Data.Char |
71 | import Data.Maybe | ||
72 | import Data.List | 71 | import Data.List |
73 | import Data.OpenPGP.Internal | 72 | import Data.OpenPGP.Internal |
74 | import qualified Data.ByteString.Lazy as LZ | 73 | import qualified Data.ByteString.Lazy as LZ |
@@ -326,7 +325,7 @@ secret_key_fields DSA = ['x'] | |||
326 | secret_key_fields _ = undefined -- Nothing in the spec. Maybe empty | 325 | secret_key_fields _ = undefined -- Nothing in the spec. Maybe empty |
327 | 326 | ||
328 | (!) :: (Eq k) => [(k,v)] -> k -> v | 327 | (!) :: (Eq k) => [(k,v)] -> k -> v |
329 | (!) xs = fromJust . (`lookup` xs) | 328 | (!) xs k = let Just x = lookup k xs in x |
330 | 329 | ||
331 | -- Need this seperate for trailer calculation | 330 | -- Need this seperate for trailer calculation |
332 | signature_packet_start :: Packet -> B.ByteString | 331 | signature_packet_start :: Packet -> B.ByteString |
@@ -461,7 +460,7 @@ put_packet p@(PublicKeyPacket { version = v, timestamp = timestamp, | |||
461 | | v == 3 = | 460 | | v == 3 = |
462 | final (B.concat $ [ | 461 | final (B.concat $ [ |
463 | B.singleton 3, encode timestamp, | 462 | B.singleton 3, encode timestamp, |
464 | encode (fromJust $ v3_days_of_validity p), | 463 | encode v3_days, |
465 | encode algorithm | 464 | encode algorithm |
466 | ] ++ material) | 465 | ] ++ material) |
467 | | v == 4 = | 466 | | v == 4 = |
@@ -469,6 +468,7 @@ put_packet p@(PublicKeyPacket { version = v, timestamp = timestamp, | |||
469 | B.singleton 4, encode timestamp, encode algorithm | 468 | B.singleton 4, encode timestamp, encode algorithm |
470 | ] ++ material) | 469 | ] ++ material) |
471 | where | 470 | where |
471 | Just v3_days = v3_days_of_validity p | ||
472 | final x = (x, if is_subkey then 14 else 6) | 472 | final x = (x, if is_subkey then 14 else 6) |
473 | material = map (encode . (key !)) (public_key_fields algorithm) | 473 | material = map (encode . (key !)) (public_key_fields algorithm) |
474 | put_packet (CompressedDataPacket { compression_algorithm = algorithm, | 474 | put_packet (CompressedDataPacket { compression_algorithm = algorithm, |