hOpenPGP 1.0 → 1.0.1
raw patch · 2 files changed
+30/−9 lines, 2 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- Data/Conduit/OpenPGP/Keyring.hs +28/−7
- hOpenPGP.cabal +2/−2
Data/Conduit/OpenPGP/Keyring.hs view
@@ -60,11 +60,32 @@ parseTK True = publictk True <|> secrettk True parseTK False = publictk False <|> secrettk False <|> brokentk 6 <|> brokentk 5 -(.::.) = (.) . (.) . (.) . (.) . (.)+data UidOrUat = I String | A [UserAttrSubPacket]+splitUs :: [(UidOrUat, [SignaturePayload])] -> ([(String, [SignaturePayload])], [([UserAttrSubPacket], [SignaturePayload])])+splitUs us = (is, as)+ where+ is = map unI (filter isI us)+ as = map unA (filter isA us)+ isI ((I _), _) = True+ isI _ = False+ isA ((A _), _) = True+ isA _ = False+ unI ((I x), y) = (x, y)+ unA ((A x), y) = (x, y) publictk, secrettk :: Bool -> Parser [Pkt] (Maybe TK)-publictk intolerant = (Just .::. TK) <$> pkpayload <*> concatMany (signature intolerant [KeyRevocationSig,SignatureDirectlyOnAKey]) <*> (if intolerant then some else many) (signeduid intolerant) <*> many (signeduat intolerant) <*> many (signedorrevokedpubsubkey intolerant)-secrettk intolerant = (Just .::. TK) <$> skpayload <*> concatMany (signature intolerant [KeyRevocationSig,SignatureDirectlyOnAKey]) <*> (if intolerant then some else many) (signeduid intolerant) <*> many (signeduat intolerant) <*> many (raworsignedorrevokedsecsubkey intolerant)+publictk intolerant = do+ pkp <- pkpayload+ pkpsigs <- concatMany (signature intolerant [KeyRevocationSig,SignatureDirectlyOnAKey])+ (uids, uats) <- fmap splitUs (many (signeduid intolerant <|> signeduat intolerant)) -- FIXME: require >=1 uid if intolerant+ subs <- many (signedorrevokedpubsubkey intolerant)+ return $! Just (TK pkp pkpsigs uids uats subs)+secrettk intolerant = do+ skp <- skpayload+ skpsigs <- concatMany (signature intolerant [KeyRevocationSig,SignatureDirectlyOnAKey])+ (uids, uats) <- fmap splitUs (many (signeduid intolerant <|> signeduat intolerant)) -- FIXME: require >=1 uid if intolerant?+ subs <- many (raworsignedorrevokedsecsubkey intolerant)+ return $! Just (TK skp skpsigs uids uats subs) brokentk :: Int -> Parser [Pkt] (Maybe TK) brokentk 6 = const Nothing <$> broken 6 <* many (signature False [KeyRevocationSig,SignatureDirectlyOnAKey]) <* many (signeduid False) <* many (signeduat False) <* many (signedorrevokedpubsubkey False)@@ -92,18 +113,18 @@ isSP' (SigV4 st _ _ _ _ _ _) = st `elem` rts isSP' _ = False -signeduid :: Bool -> Parser [Pkt] (String, [SignaturePayload])+signeduid :: Bool -> Parser [Pkt] (UidOrUat, [SignaturePayload]) signeduid intolerant = do [UserIdPkt u] <- satisfy isUID sigs <- concatMany (signature intolerant [GenericCert, PersonaCert, CasualCert, PositiveCert, CertRevocationSig])- return (u, sigs)+ return (I u, sigs) where isUID [UserIdPkt _] = True isUID _ = False -signeduat :: Bool -> Parser [Pkt] ([UserAttrSubPacket], [SignaturePayload])+signeduat :: Bool -> Parser [Pkt] (UidOrUat, [SignaturePayload]) signeduat intolerant = do [UserAttributePkt us] <- satisfy isUAt sigs <- concatMany (signature intolerant [GenericCert, PersonaCert, CasualCert, PositiveCert, CertRevocationSig])- return (us, sigs)+ return (A us, sigs) where isUAt [UserAttributePkt _] = True isUAt _ = False
hOpenPGP.cabal view
@@ -1,5 +1,5 @@ Name: hOpenPGP-Version: 1.0+Version: 1.0.1 Synopsis: native Haskell implementation of OpenPGP (RFC4880) Description: native Haskell implementation of OpenPGP (RFC4880) Homepage: http://floss.scru.org/hOpenPGP/@@ -244,4 +244,4 @@ source-repository this type: git location: git://git.debian.org/users/clint/hOpenPGP.git- tag: v1.0+ tag: v1.0.1