diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/KeyRing/Types.hs | 5 | ||||
-rw-r--r-- | lib/PacketTranscoder.hs | 6 |
2 files changed, 8 insertions, 3 deletions
diff --git a/lib/KeyRing/Types.hs b/lib/KeyRing/Types.hs index e1e19f5..f5fd879 100644 --- a/lib/KeyRing/Types.hs +++ b/lib/KeyRing/Types.hs | |||
@@ -299,10 +299,11 @@ data InputFileContext = InputFileContext | |||
299 | -- which is used for finger-printing and as a lookup key into | 299 | -- which is used for finger-printing and as a lookup key into |
300 | -- maps. This type may be changed to an actual fingerprint in | 300 | -- maps. This type may be changed to an actual fingerprint in |
301 | -- in the future. | 301 | -- in the future. |
302 | type KeyKey = [(Char,MPI)] | 302 | newtype KeyKey = KeyKey [(Char,MPI)] |
303 | deriving (Eq,Ord,Show) | ||
303 | 304 | ||
304 | keykey :: Packet -> KeyKey | 305 | keykey :: Packet -> KeyKey |
305 | keykey k = concatMap (\c -> (maybeToList $ find (\(f,x) -> f==c) (key k))) (public_key_fields $ key_algorithm k) | 306 | keykey k = KeyKey $ concatMap (\c -> (maybeToList $ find (\(f,x) -> f==c) (key k))) (public_key_fields $ key_algorithm k) |
306 | 307 | ||
307 | isKey :: Packet -> Bool | 308 | isKey :: Packet -> Bool |
308 | isKey (PublicKeyPacket {}) = True | 309 | isKey (PublicKeyPacket {}) = True |
diff --git a/lib/PacketTranscoder.hs b/lib/PacketTranscoder.hs index 6eadfe4..eaed938 100644 --- a/lib/PacketTranscoder.hs +++ b/lib/PacketTranscoder.hs | |||
@@ -315,8 +315,12 @@ keyQueries grip ringPackets = (mwk, fmap makeQuery keys) | |||
315 | m2 :: Map.Map KeyKey (Maybe Packet, MappedPacket, (Map.Map String [Packet])) | 315 | m2 :: Map.Map KeyKey (Maybe Packet, MappedPacket, (Map.Map String [Packet])) |
316 | m2 = Map.fromList | 316 | m2 = Map.fromList |
317 | $ drop 1 | 317 | $ drop 1 |
318 | $ scanl' build ([],(Nothing,error "bug in PacketTranscoder (1)", error "bug in PacketTranscoder (2)")) pss | 318 | $ scanl' build failure pss |
319 | where | 319 | where |
320 | failure = ( error "bug in PacketTranscoder(3)" | ||
321 | , (Nothing,error "bug in PacketTranscoder (1)" | ||
322 | , error "bug in PacketTranscoder (2)") | ||
323 | ) | ||
320 | build (_,(main0,_,_)) ps = (kk,(main,kp,uidmap ps')) | 324 | build (_,(main0,_,_)) ps = (kk,(main,kp,uidmap ps')) |
321 | where | 325 | where |
322 | main | is_subkey (packet kp) = main0 | 326 | main | is_subkey (packet kp) = main0 |