diff options
author | joe <joe@jerkface.net> | 2014-05-11 20:11:35 -0400 |
---|---|---|
committer | joe <joe@jerkface.net> | 2014-05-11 20:11:35 -0400 |
commit | 5c1b54b54622b18fe3fd57a5c2c892613d33a7ba (patch) | |
tree | 3f64dc577d08284295fe6e7842e33ab9e02c9fd1 /KeyRing.hs | |
parent | 03551eaa9767db678a521f082d00b88665d0f3da (diff) |
toStrict is not in wheezy, fixing build
Diffstat (limited to 'KeyRing.hs')
-rw-r--r-- | KeyRing.hs | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -1439,6 +1439,9 @@ spemPacket _ = Nothing | |||
1439 | spemCert (PEMCertificate p) = Just p | 1439 | spemCert (PEMCertificate p) = Just p |
1440 | spemCert _ = Nothing | 1440 | spemCert _ = Nothing |
1441 | 1441 | ||
1442 | toStrict :: L.ByteString -> S.ByteString | ||
1443 | toStrict = foldr1 (<>) . L.toChunks | ||
1444 | |||
1442 | parseCertBlob comp bs = do | 1445 | parseCertBlob 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 |