diff options
Diffstat (limited to 'lib/KeyRing/Types.hs')
-rw-r--r-- | lib/KeyRing/Types.hs | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/lib/KeyRing/Types.hs b/lib/KeyRing/Types.hs index 2383140..e1e19f5 100644 --- a/lib/KeyRing/Types.hs +++ b/lib/KeyRing/Types.hs | |||
@@ -2,9 +2,10 @@ | |||
2 | module KeyRing.Types where | 2 | module KeyRing.Types where |
3 | 3 | ||
4 | import Data.Char (isLower,toLower) | 4 | import Data.Char (isLower,toLower) |
5 | import Data.List (groupBy) | 5 | import Data.List (groupBy,find) |
6 | import Data.Map as Map (Map) | 6 | import Data.Map as Map (Map) |
7 | import qualified Data.Map as Map | 7 | import qualified Data.Map as Map |
8 | import Data.Maybe (maybeToList) | ||
8 | import Data.OpenPGP | 9 | import Data.OpenPGP |
9 | import Data.OpenPGP.Util | 10 | import Data.OpenPGP.Util |
10 | import Data.Time.Clock | 11 | import Data.Time.Clock |
@@ -298,16 +299,10 @@ data InputFileContext = InputFileContext | |||
298 | -- which is used for finger-printing and as a lookup key into | 299 | -- which is used for finger-printing and as a lookup key into |
299 | -- maps. This type may be changed to an actual fingerprint in | 300 | -- maps. This type may be changed to an actual fingerprint in |
300 | -- in the future. | 301 | -- in the future. |
301 | type KeyKey = [L.ByteString] | 302 | type KeyKey = [(Char,MPI)] |
302 | 303 | ||
303 | keykey :: Packet -> KeyKey | 304 | keykey :: Packet -> KeyKey |
304 | keykey key = | 305 | keykey k = concatMap (\c -> (maybeToList $ find (\(f,x) -> f==c) (key k))) (public_key_fields $ key_algorithm k) |
305 | -- Note: The key's timestamp is normally included in it's fingerprint. | ||
306 | -- This is undesirable for kiki because it causes the same | ||
307 | -- key to be imported multiple times and show as apparently | ||
308 | -- distinct keys with different fingerprints. | ||
309 | -- Thus, we will remove the timestamp. | ||
310 | fingerprint_material (key {timestamp=0}) -- TODO: smaller key? | ||
311 | 306 | ||
312 | isKey :: Packet -> Bool | 307 | isKey :: Packet -> Bool |
313 | isKey (PublicKeyPacket {}) = True | 308 | isKey (PublicKeyPacket {}) = True |