summaryrefslogtreecommitdiff
path: root/KeyRing.hs
diff options
context:
space:
mode:
authorjoe <joe@jerkface.net>2014-05-11 20:11:35 -0400
committerjoe <joe@jerkface.net>2014-05-11 20:11:35 -0400
commit5c1b54b54622b18fe3fd57a5c2c892613d33a7ba (patch)
tree3f64dc577d08284295fe6e7842e33ab9e02c9fd1 /KeyRing.hs
parent03551eaa9767db678a521f082d00b88665d0f3da (diff)
toStrict is not in wheezy, fixing build
Diffstat (limited to 'KeyRing.hs')
-rw-r--r--KeyRing.hs7
1 files changed, 5 insertions, 2 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