diff options
author | Stephen Paul Weber <singpolyma@singpolyma.net> | 2012-04-27 17:19:41 -0500 |
---|---|---|
committer | Stephen Paul Weber <singpolyma@singpolyma.net> | 2012-04-27 17:19:41 -0500 |
commit | af48ca0db78ad9ccce5e8ae2130611486c717d56 (patch) | |
tree | c50cfffa0c5e73a7fe0548485a382f0aa28ed3af | |
parent | c839363df7bc06519ef577b02de11200ceb2ba9a (diff) |
ensure full fingerprint padding
-rw-r--r-- | Data/OpenPGP.hs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Data/OpenPGP.hs b/Data/OpenPGP.hs index 41a5d4e..cbc801e 100644 --- a/Data/OpenPGP.hs +++ b/Data/OpenPGP.hs | |||
@@ -813,12 +813,13 @@ parse_signature_subpacket 12 = do | |||
813 | sensitive = if bitfield .&. 0x40 == 0x40 then True else False, | 813 | sensitive = if bitfield .&. 0x40 == 0x40 then True else False, |
814 | revocation_key_algorithm = kalgo, | 814 | revocation_key_algorithm = kalgo, |
815 | revocation_key_fingerprint = | 815 | revocation_key_fingerprint = |
816 | map toUpper $ foldr (pad `oo` showHex) "" (B.unpack fpr) | 816 | pad $ map toUpper $ foldr (padB `oo` showHex) "" (B.unpack fpr) |
817 | } | 817 | } |
818 | where | 818 | where |
819 | oo = (.) . (.) | 819 | oo = (.) . (.) |
820 | pad s | odd $ length s = '0':s | 820 | padB s | odd $ length s = '0':s |
821 | | otherwise = s | 821 | | otherwise = s |
822 | pad s = replicate (40 - length s) '0' ++ s | ||
822 | -- IssuerPacket, http://tools.ietf.org/html/rfc4880#section-5.2.3.5 | 823 | -- IssuerPacket, http://tools.ietf.org/html/rfc4880#section-5.2.3.5 |
823 | parse_signature_subpacket 16 = do | 824 | parse_signature_subpacket 16 = do |
824 | keyid <- get :: Get Word64 | 825 | keyid <- get :: Get Word64 |