diff options
author | joe <joe@jerkface.net> | 2014-05-01 00:14:51 -0400 |
---|---|---|
committer | joe <joe@jerkface.net> | 2014-05-01 00:14:51 -0400 |
commit | 0fe29f435045f4ed58cd3f3d101efd313e80bebc (patch) | |
tree | 0d1f0fe12ed2b57faf4eb5c3ce2c39c33f035c89 | |
parent | 9b75792a215c634c6147c5a4d0f73f71c1ec46b1 (diff) |
Document intention for unspilled KeyDB and decryption.
-rw-r--r-- | KeyRing.hs | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -1666,6 +1666,9 @@ makeMemoizingDecrypter operation ctx = do | |||
1666 | && isNothing (passSpecKeySpec sp)) | 1666 | && isNothing (passSpecKeySpec sp)) |
1667 | $ kPassphrases operation | 1667 | $ kPassphrases operation |
1668 | unkeysRef <- newIORef Map.empty | 1668 | unkeysRef <- newIORef Map.empty |
1669 | -- TODO: | ||
1670 | -- Use buildKeyDB on unspilled files to create an unspillable KeyDB. | ||
1671 | -- This KeyDB should be used later by decryptIt. | ||
1669 | return $ doDecrypt unkeysRef (pws `Map.union` pws2) defpw | 1672 | return $ doDecrypt unkeysRef (pws `Map.union` pws2) defpw |
1670 | where | 1673 | where |
1671 | doDecrypt :: IORef (Map.Map KeyKey Packet) | 1674 | doDecrypt :: IORef (Map.Map KeyKey Packet) |
@@ -1681,6 +1684,9 @@ makeMemoizingDecrypter operation ctx = do | |||
1681 | 1684 | ||
1682 | decryptIt [] = return BadPassphrase | 1685 | decryptIt [] = return BadPassphrase |
1683 | decryptIt (getpw:getpws) = do | 1686 | decryptIt (getpw:getpws) = do |
1687 | -- TODO: This function should use mergeKeyPacket to | ||
1688 | -- combine the packet with it's unspilled version before | ||
1689 | -- attempting to decrypt it. | ||
1684 | pw <- getpw | 1690 | pw <- getpw |
1685 | let wkun = fromMaybe wk $ decryptSecretKey pw wk | 1691 | let wkun = fromMaybe wk $ decryptSecretKey pw wk |
1686 | case symmetric_algorithm wkun of | 1692 | case symmetric_algorithm wkun of |