diff options
author | Joe Crayne <joe@jerkface.net> | 2019-07-01 03:08:58 -0400 |
---|---|---|
committer | Joe Crayne <joe@jerkface.net> | 2019-07-01 03:08:58 -0400 |
commit | b418ea873b6390bee1247e5a1e9cd868fcc638f1 (patch) | |
tree | 75442e4e5d9aa5af73d40861639f385e172f52be /lib/KeyRing | |
parent | bc0458ee540da677a04eeddf9b4e0fe8a8991e93 (diff) |
More merging of 0bc53f99cfd70f3a18802604d7ef3174d004db4c.
Diffstat (limited to 'lib/KeyRing')
-rw-r--r-- | lib/KeyRing/BuildKeyDB.hs | 29 |
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 | ||
1045 | keyCompare :: String -> Packet -> Packet -> Ordering | ||
1046 | keyCompare what (SecretKeyPacket {}) (PublicKeyPacket {}) = LT | ||
1047 | keyCompare what (PublicKeyPacket {}) (SecretKeyPacket {}) = GT | ||
1048 | keyCompare what a b | keykey a==keykey b = EQ | ||
1049 | keyCompare 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 | ||
1057 | dbInsertPacket :: KeyData -> FilePath -> (Int,(Packet,Packet,(Packet,Map.Map FilePath Packet))) -> Maybe KeyData | 1046 | dbInsertPacket :: KeyData -> FilePath -> (Int,(Packet,Packet,(Packet,Map.Map FilePath Packet))) -> Maybe KeyData |
1058 | dbInsertPacket kd filename (n,(top,sub,ptt@(p,trustmap))) = update (Just kd) | 1047 | dbInsertPacket 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 | ||
1122 | secretToPublic :: Packet -> Packet | ||
1123 | secretToPublic 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 | } | ||
1134 | secretToPublic pkt = pkt | ||
1135 | |||
1136 | |||
1137 | ifSecret :: Packet -> t -> t -> t | ||
1138 | ifSecret (SecretKeyPacket {}) t f = t | ||
1139 | ifSecret _ t f = f | ||
1140 | 1111 | ||
1141 | instance ASN1Object RSAPrivateKey where | 1112 | instance ASN1Object RSAPrivateKey where |
1142 | toASN1 rsa@(RSAPrivateKey {}) | 1113 | toASN1 rsa@(RSAPrivateKey {}) |