Commits

Kristian Fiskerstrand committed 6771e2b

Long keyid in MRindex

Comments (0)

Files changed (3)

Error_on_standalone_revokation_certificate

-# HG changeset patch
-# Parent a66d15563b192757c7b04c1303015cabe5d1b722
-Add check if upload is a revocation certificate, and if it is, produce an error message tailored for this
-
-diff -r a66d15563b19 dbserver.ml
---- a/dbserver.ml	Wed Aug 01 15:23:57 2012 +0100
-+++ b/dbserver.ml	Fri Aug 10 18:19:41 2012 +0200
-@@ -520,6 +520,12 @@
-                               plerror 2 "key %s %s"
-                                 (KeyHash.hexify (KeyHash.hash origkey))
-                                 "could not be parsed by KeyMerge.canonicalize"
-+                          | Fixkey.Standalone_revocation_certificate ->
-+                               cout#write_string ("Add failed: This is a stand-alone " ^
-+                                                  "revocation certificate. Revocation " ^
-+                                                  "certificates should be imported to a " ^
-+                                                  "public key before being published to " ^
-+                                                  "a keyserver");
-                           | Bdb.Key_exists as e ->
-                               cout#write_string
-                               ("Add failed: identical key already " ^
-diff -r a66d15563b19 fixkey.ml
---- a/fixkey.ml	Wed Aug 01 15:23:57 2012 +0100
-+++ b/fixkey.ml	Fri Aug 10 18:19:41 2012 +0200
-@@ -28,6 +28,7 @@
- module Map = PMap.Map
- 
- exception Bad_key
-+exception Standalone_revocation_certificate
- 
- 
- (** list of filters currently applied on incoming keys.  Filter types are
-@@ -114,7 +115,26 @@
- (** Returns canonicalized version of key.  Raises Bad_key if key should simply
-   be discarded
- *)
-+let is_revocation_signature pack =
-+   match pack.packet_type with
-+    | Signature_Packet ->
-+      let parsed_signature = ParsePGP.parse_signature pack in
-+       let result = match parsed_signature with
-+         | V3sig s -> (match (int_to_sigtype s.v3s_sigtype) with
-+           | Key_revocation_signature | Subkey_revocation_signature
-+             | Certification_revocation_signature -> true
-+           | _ -> false)
-+         | V4sig s -> (match (int_to_sigtype s.v4s_sigtype) with
-+           | Key_revocation_signature | Subkey_revocation_signature
-+             | Certification_revocation_signature -> true
-+           | _ -> false)
-+         in
-+         result
-+    | _ -> false
-+
- let canonicalize key =
-+  if is_revocation_signature (List.hd key)
-+    then raise Standalone_revocation_certificate;
-   try KeyMerge.dedup_key key
-   with KeyMerge.Unparseable_packet_sequence -> raise Bad_key
- 
-diff -r a66d15563b19 fixkey.mli
---- a/fixkey.mli	Wed Aug 01 15:23:57 2012 +0100
-+++ b/fixkey.mli	Fri Aug 10 18:19:41 2012 +0200
-@@ -1,4 +1,5 @@
- exception Bad_key
-+exception Standalone_revocation_certificate
- val filters : string list
- val get_keypacket : KeyMerge.pkey -> Packet.packet
- val ( |= ) : ('a, 'b) PMap.Map.t -> 'a -> 'b
+# HG changeset patch
+# Parent e2d4ec6c214703fed821847dea84349edeabf48b
+
+diff -r e2d4ec6c2147 mRindex.ml
+--- a/mRindex.ml	Fri Aug 10 20:50:24 2012 +0200
++++ b/mRindex.ml	Tue Aug 14 22:00:52 2012 +0200
+@@ -111,7 +111,7 @@
+         (Int64.add pki.pk_ctime (Int64.mul daysecs (Int64.of_int days)))
+   in
+   let key_line = sprintf "pub:%s:%d:%d:%Ld:%s:%s"
+-                   keyid
++                   full_keyid
+                    pki.pk_alg
+                    pki.pk_keylen
+                    pki.pk_ctime
-Error_on_standalone_revokation_certificate
+Use Long KeyID
 SubkeySignature
 # Placed by Bitbucket