diff options
author | Clint Adams <clint@debian.org> | 2012-05-21 22:56:00 -0400 |
---|---|---|
committer | Clint Adams <clint@debian.org> | 2012-05-21 22:56:00 -0400 |
commit | 4898b00a5221c9ceaa36d04ceea406bcdd12ccd8 (patch) | |
tree | 7bd067b802182292fab46aac169fc2fe4d039183 /Data/OpenPGP.hs | |
parent | d25ae59b2072891c95e5e1747fee87f9b98bb1f5 (diff) |
Parse V3 signature packets.
Diffstat (limited to 'Data/OpenPGP.hs')
-rw-r--r-- | Data/OpenPGP.hs | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/Data/OpenPGP.hs b/Data/OpenPGP.hs index 12bef74..4fd32e2 100644 --- a/Data/OpenPGP.hs +++ b/Data/OpenPGP.hs | |||
@@ -403,7 +403,26 @@ parse_packet :: Word8 -> Get Packet | |||
403 | parse_packet 2 = do | 403 | parse_packet 2 = do |
404 | version <- get | 404 | version <- get |
405 | case version of | 405 | case version of |
406 | 3 -> error "V3 signatures are not supported yet" -- TODO: V3 sigs | 406 | 3 -> do |
407 | _ <- fmap (assertProp (==5)) (get :: Get Word8) | ||
408 | signature_type <- get | ||
409 | creation_time <- get :: Get Word32 | ||
410 | key_id <- get :: Get Word64 | ||
411 | key_algorithm <- get | ||
412 | hash_algorithm <- get | ||
413 | hash_head <- get | ||
414 | signature <- listUntilEnd | ||
415 | return SignaturePacket { | ||
416 | version = version, | ||
417 | signature_type = signature_type, | ||
418 | key_algorithm = key_algorithm, | ||
419 | hash_algorithm = hash_algorithm, | ||
420 | hashed_subpackets = [], | ||
421 | unhashed_subpackets = [], | ||
422 | hash_head = hash_head, | ||
423 | signature = signature, | ||
424 | trailer = B.concat [encode creation_time, encode key_id] -- TODO: put this somewhere better | ||
425 | } | ||
407 | 4 -> do | 426 | 4 -> do |
408 | signature_type <- get | 427 | signature_type <- get |
409 | key_algorithm <- get | 428 | key_algorithm <- get |