diff options
author | joe <joe@jerkface.net> | 2014-05-09 21:56:13 -0400 |
---|---|---|
committer | joe <joe@jerkface.net> | 2014-05-09 21:56:13 -0400 |
commit | ae090c58719726fd0027c4c606bc82faf55b1bc9 (patch) | |
tree | e799627ba9f83c7bee5c5ad61b4ead0701378275 | |
parent | 62428c7e9311b0794cf0a87f0276f73e530874de (diff) |
--torhash accepts CERTIFICATE pem
-rw-r--r-- | kiki.hs | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -396,7 +396,9 @@ show_torhash pubkey _ = do | |||
396 | $ pemParser (Just "RSA PUBLIC KEY") | 396 | $ pemParser (Just "RSA PUBLIC KEY") |
397 | pkcs8 = fmap ( parsekey (\f (RSAKey8 n e) -> f n e) . pemBlob ) | 397 | pkcs8 = fmap ( parsekey (\f (RSAKey8 n e) -> f n e) . pemBlob ) |
398 | $ pemParser (Just "PUBLIC KEY") | 398 | $ pemParser (Just "PUBLIC KEY") |
399 | keys = catMaybes $ scanAndParse (pkcs1 <> pkcs8) $ Char8.lines bs | 399 | cert = fmap (fmap pcertKey . parseCertBlob False . pemBlob) |
400 | $ pemParser (Just "CERTIFICATE") | ||
401 | keys = catMaybes $ scanAndParse (pkcs1 <> pkcs8 <> cert) $ Char8.lines bs | ||
400 | mapM_ (putStrLn . addy . torhash) keys | 402 | mapM_ (putStrLn . addy . torhash) keys |
401 | 403 | ||
402 | 404 | ||