diff options
author | joe <joe@jerkface.net> | 2014-05-11 00:48:35 -0400 |
---|---|---|
committer | joe <joe@jerkface.net> | 2014-05-11 00:48:35 -0400 |
commit | 0b0c24da3fc2389dbf92f2b105b588763916971e (patch) | |
tree | 2e572ba043a150e2d0007d627b36726f86c36a27 | |
parent | 91efbba981f62b60514e6f250907fb654c622c79 (diff) |
import certificate blobs as 'x509cert@' binary annotations.
-rw-r--r-- | KeyRing.hs | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -1519,7 +1519,14 @@ doImport doDecrypt db (fname,subspec,ms,_) = do | |||
1519 | if (not (null tailms) || null m0) | 1519 | if (not (null tailms) || null m0) |
1520 | then return $ AmbiguousKeySpec fname | 1520 | then return $ AmbiguousKeySpec fname |
1521 | else do | 1521 | else do |
1522 | r <- doImportG doDecrypt db m0 [mkUsage tag] fname key | 1522 | let kk = keykey key |
1523 | cs = filter (\c -> kk==keykey (pcertKey c)) certs | ||
1524 | blobs = map mkCertNotation $ nub $ map pcertBlob cs | ||
1525 | mkCertNotation bs = NotationDataPacket | ||
1526 | { human_readable = False | ||
1527 | , notation_name = "x509cert@" | ||
1528 | , notation_value = Char8.unpack bs } | ||
1529 | r <- doImportG doDecrypt db m0 (mkUsage tag:blobs) fname key | ||
1523 | try r $ \(db',report') -> do | 1530 | try r $ \(db',report') -> do |
1524 | return $ KikiSuccess (db',report++report') | 1531 | return $ KikiSuccess (db',report++report') |
1525 | 1532 | ||