summaryrefslogtreecommitdiff
path: root/lib/KeyRing
diff options
context:
space:
mode:
authorJoe Crayne <joe@jerkface.net>2019-07-01 03:08:58 -0400
committerJoe Crayne <joe@jerkface.net>2019-07-01 03:08:58 -0400
commitb418ea873b6390bee1247e5a1e9cd868fcc638f1 (patch)
tree75442e4e5d9aa5af73d40861639f385e172f52be /lib/KeyRing
parentbc0458ee540da677a04eeddf9b4e0fe8a8991e93 (diff)
More merging of 0bc53f99cfd70f3a18802604d7ef3174d004db4c.
Diffstat (limited to 'lib/KeyRing')
-rw-r--r--lib/KeyRing/BuildKeyDB.hs29
1 files changed, 0 insertions, 29 deletions
diff --git a/lib/KeyRing/BuildKeyDB.hs b/lib/KeyRing/BuildKeyDB.hs
index 6de217b..d8f8d50 100644
--- a/lib/KeyRing/BuildKeyDB.hs
+++ b/lib/KeyRing/BuildKeyDB.hs
@@ -1042,17 +1042,6 @@ secp256k1_id = 0x2b8104000a
1042-} 1042-}
1043 1043
1044 1044
1045keyCompare :: String -> Packet -> Packet -> Ordering
1046keyCompare what (SecretKeyPacket {}) (PublicKeyPacket {}) = LT
1047keyCompare what (PublicKeyPacket {}) (SecretKeyPacket {}) = GT
1048keyCompare what a b | keykey a==keykey b = EQ
1049keyCompare what a b = error $ unlines ["Unable to merge "++what++":"
1050 , fingerprint a
1051 , PP.ppShow a
1052 , fingerprint b
1053 , PP.ppShow b
1054 ]
1055
1056 1045
1057dbInsertPacket :: KeyData -> FilePath -> (Int,(Packet,Packet,(Packet,Map.Map FilePath Packet))) -> Maybe KeyData 1046dbInsertPacket :: KeyData -> FilePath -> (Int,(Packet,Packet,(Packet,Map.Map FilePath Packet))) -> Maybe KeyData
1058dbInsertPacket kd filename (n,(top,sub,ptt@(p,trustmap))) = update (Just kd) 1047dbInsertPacket kd filename (n,(top,sub,ptt@(p,trustmap))) = update (Just kd)
@@ -1119,24 +1108,6 @@ dbInsertPacket kd filename (n,(top,sub,ptt@(p,trustmap))) = update (Just kd)
1119 mergeSubSig n sig Nothing = error $ 1108 mergeSubSig n sig Nothing = error $
1120 "Unable to merge subkey signature: "++(words (show sig) >>= take 1) 1109 "Unable to merge subkey signature: "++(words (show sig) >>= take 1)
1121 1110
1122secretToPublic :: Packet -> Packet
1123secretToPublic pkt@(SecretKeyPacket {}) =
1124 PublicKeyPacket { version = version pkt
1125 , timestamp = timestamp pkt
1126 , key_algorithm = key_algorithm pkt
1127 -- , ecc_curve = ecc_curve pkt
1128 , key = let seckey = key pkt
1129 pubs = public_key_fields (key_algorithm pkt)
1130 in filter (\(k,v) -> k `elem` pubs) seckey
1131 , is_subkey = is_subkey pkt
1132 , v3_days_of_validity = Nothing
1133 }
1134secretToPublic pkt = pkt
1135
1136
1137ifSecret :: Packet -> t -> t -> t
1138ifSecret (SecretKeyPacket {}) t f = t
1139ifSecret _ t f = f
1140 1111
1141instance ASN1Object RSAPrivateKey where 1112instance ASN1Object RSAPrivateKey where
1142 toASN1 rsa@(RSAPrivateKey {}) 1113 toASN1 rsa@(RSAPrivateKey {})