summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--KeyRing.hs7
-rw-r--r--TimeUtil.hs2
2 files changed, 6 insertions, 3 deletions
diff --git a/KeyRing.hs b/KeyRing.hs
index 8864df4..e0c3b77 100644
--- a/KeyRing.hs
+++ b/KeyRing.hs
@@ -1439,6 +1439,9 @@ spemPacket _ = Nothing
1439spemCert (PEMCertificate p) = Just p 1439spemCert (PEMCertificate p) = Just p
1440spemCert _ = Nothing 1440spemCert _ = Nothing
1441 1441
1442toStrict :: L.ByteString -> S.ByteString
1443toStrict = foldr1 (<>) . L.toChunks
1444
1442parseCertBlob comp bs = do 1445parseCertBlob comp bs = do
1443 asn1 <- either (const Nothing) Just 1446 asn1 <- either (const Nothing) Just
1444 $ decodeASN1 DER bs 1447 $ decodeASN1 DER bs
@@ -1449,8 +1452,8 @@ parseCertBlob comp bs = do
1449 case X509.certPubKey cert of 1452 case X509.certPubKey cert of
1450 X509.PubKeyRSA key -> do 1453 X509.PubKeyRSA key -> do
1451 let withoutkey = 1454 let withoutkey =
1452 let ekey = Char8.toStrict $ encodeASN1 DER (toASN1 key []) 1455 let ekey = toStrict $ encodeASN1 DER (toASN1 key [])
1453 (pre,post) = S.breakSubstring ekey $ Char8.toStrict bs 1456 (pre,post) = S.breakSubstring ekey $ toStrict bs
1454 post' = S.drop (S.length ekey) post 1457 post' = S.drop (S.length ekey) post
1455 len :: Word16 1458 len :: Word16
1456 len = if S.null post then maxBound 1459 len = if S.null post then maxBound
diff --git a/TimeUtil.hs b/TimeUtil.hs
index 77e85bf..1c241a4 100644
--- a/TimeUtil.hs
+++ b/TimeUtil.hs
@@ -85,7 +85,7 @@ dateParser = ScanningParser ffst pbdy
85 ffst bs = do 85 ffst bs = do
86 let (h,bs') = L.splitAt 6 bs 86 let (h,bs') = L.splitAt 6 bs
87 if h=="Date: " 87 if h=="Date: "
88 then return $ parseRFC2822 $ L.toStrict bs' 88 then return $ parseRFC2822 $ foldr1 S.append $ L.toChunks bs'
89 else Nothing 89 else Nothing
90 pbdy date xs = (date,xs) 90 pbdy date xs = (date,xs)
91 91