asn1-encoding 0.9.4 → 0.9.5
raw patch · 5 files changed
+6/−5 lines, 5 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
+ Data.ASN1.Error: TypePrimitiveInvalid :: String -> ASN1Error
- Data.ASN1.Object: fromASN1 :: [ASN1] -> Either String (a, [ASN1])
+ Data.ASN1.Object: fromASN1 :: ASN1Object a => [ASN1] -> Either String (a, [ASN1])
- Data.ASN1.Object: toASN1 :: a -> ASN1S
+ Data.ASN1.Object: toASN1 :: ASN1Object a => a -> ASN1S
Files
- Data/ASN1/BinaryEncoding/Parse.hs +1/−1
- Data/ASN1/Error.hs +1/−0
- Data/ASN1/Prim.hs +2/−2
- Data/ASN1/Serialize.hs +1/−1
- asn1-encoding.cabal +1/−1
Data/ASN1/BinaryEncoding/Parse.hs view
@@ -124,7 +124,7 @@ , remBytes) go (ParseState stackEnd (ExpectPrimitive len cont) pos) bs = case runGetPrimitive cont len pos bs of- Fail _ -> error "primitive parsing failed"+ Fail _ -> Left ParsingPartial Partial f -> Right (([], ParseState stackEnd (ExpectPrimitive len $ Just f) pos), B.empty) Done p nPos remBytes -> Right (([Primitive p], ParseState stackEnd (ExpectHeader Nothing) nPos), remBytes)
Data/ASN1/Error.hs view
@@ -25,6 +25,7 @@ | ParsingPartial -- ^ Parsing is not finished, there is construction unended. | TypeNotImplemented String -- ^ Decoding of a type that is not implemented. Contribution welcome. | TypeDecodingFailed String -- ^ Decoding of a knowed type failed.+ | TypePrimitiveInvalid String -- ^ Invalid primitive type | PolicyFailed String String -- ^ Policy failed including the name of the policy and the reason. deriving (Typeable, Show, Eq)
Data/ASN1/Prim.hs view
@@ -169,8 +169,8 @@ decodePrimitive (ASN1Header Universal 0xb _ _) _ = Left $ TypeNotImplemented "EMBEDDED PDV" decodePrimitive (ASN1Header Universal 0xc _ _) p = getCharacterString UTF8 p decodePrimitive (ASN1Header Universal 0xd _ _) _ = Left $ TypeNotImplemented "RELATIVE-OID"-decodePrimitive (ASN1Header Universal 0x10 _ _) _ = error "sequence not a primitive"-decodePrimitive (ASN1Header Universal 0x11 _ _) _ = error "set not a primitive"+decodePrimitive (ASN1Header Universal 0x10 _ _) _ = Left $ TypePrimitiveInvalid "sequence"+decodePrimitive (ASN1Header Universal 0x11 _ _) _ = Left $ TypePrimitiveInvalid "set" decodePrimitive (ASN1Header Universal 0x12 _ _) p = getCharacterString Numeric p decodePrimitive (ASN1Header Universal 0x13 _ _) p = getCharacterString Printable p decodePrimitive (ASN1Header Universal 0x14 _ _) p = getCharacterString T61 p
Data/ASN1/Serialize.hs view
@@ -37,7 +37,7 @@ getTagLong :: Get ASN1Tag getTagLong = do t <- fromIntegral <$> getWord8- when (t == 0x80) $ error "not canonical encoding of tag"+ when (t == 0x80) $ fail "non canonical encoding of long tag" if testBit t 7 then loop (clearBit t 7) else return t
asn1-encoding.cabal view
@@ -1,5 +1,5 @@ Name: asn1-encoding-Version: 0.9.4+Version: 0.9.5 Synopsis: ASN1 data reader and writer in RAW, BER and DER forms Description: ASN1 data reader and writer in raw form with supports for high level forms of ASN1 (BER, and DER).