Subject: [openpgp] v5 fingerprints and public keys

From: Ángel <[email-masked]>
Date: Mon, 03 May 2021 00:20:07 +0200

Some comments reviewing the recent v5 commits.

Note 0ffeeaad535232a0976a3e52ba3290df941aa47d leaked some text related
to the future AEAD string-to-key ("4 optional fields", "AEAD tag", "254
or 253"...). I'm only removing them for being unspecified in the
current document.

Best,

Ángel

diff --git a/crypto-refresh.md b/crypto-refresh.md
index 087f29f..c4e36a7 100644
--- a/crypto-refresh.md
+++ b/crypto-refresh.md
@@ -414,7 +414,7 @@ It may be ill-formed in its ciphertext.
 
 A Key ID is an eight-octet scalar that identifies a key.
 Implementations SHOULD NOT assume that Key IDs are unique.
-{{enhanced-key-formats}} describes how Key IDs are formed.
+{{key-ids-and-fingerprints}} describes how Key IDs are formed.
 
 ## Text
 
@@ -1140,7 +1140,8 @@ MUST be present in the hashed area.
 (8-octet Key ID)
 
 The OpenPGP Key ID of the key issuing the signature.
-If the version of that key is greater than 4, this subpacket MUST NOT be included in the signature.
+This subpacket MUST NOT be included in the signature if the version of that key is greater than 4.
+If the superior Issuer Fingerprint subpacket is also present, their contents MUST match (Issuer would contain the low
 64 bits of the value stored in full in the Issuer Fingerprint).
 
 #### Key Expiration Time
 
@@ -1480,7 +1481,7 @@ It is useful when one signature needs to refer to, or be incorporated in, anothe
 
 The OpenPGP Key fingerprint of the key issuing the signature.
 This subpacket SHOULD be included in all signatures.
-If the version of the issuing key is 4 and an Issuer subpacket is also included in the signature, the key ID of the I
ssuer subpacket MUST match the low 64 bits of the fingerprint.
+If an Issuer subpacket is also included in the signature (only possible for keys earlier than version 5), the content
s of the Issuer subpacket MUST match those of the Issuer Fingerprint.
 
 Note that the length N of the fingerprint for a version 4 key is 20 octets; for a version 5 key N is 32.
 
@@ -1708,8 +1709,8 @@ A version 4 packet contains:
   This is algorithm-specific and described in {{algorithm-specific-parts-of-keys}}.
 
 The version 5 format is similar to the version 4 format except for the addition of a count for the key material.
-This count helps parsing secret key packets (which are an extension of the public key packet format) in the case of a
n unknown algoritm.
-In addition, fingerprints of version 5 keys are calculated differently from version 4 keys, as described in the secti
on "Enhanced Key Formats".
+This count helps parsing secret key packets (which are an extension of the public key packet format) in the case of a
n unknown algorithm.
+In addition, fingerprints of version 5 keys are calculated differently from version 4 keys, as described in {{enhance
d-key-formats}}, "Enhanced Key Formats".
 
 A version 5 packet contains:
 
@@ -1738,7 +1739,7 @@ The packet contains:
   Any other value is a symmetric-key encryption algorithm identifier.
   A version 5 packet MUST NOT use the value 255.
 
-- Only for a version 5 packet, a one-octet scalar octet count of the next 4 optional fields.
+- Only for a version 5 packet, a one-octet scalar octet count of the next 3 optional fields.
 
 - \[Optional\] If string-to-key usage octet was 255 or 254, a one-octet symmetric encryption algorithm.
 
@@ -1748,7 +1749,7 @@ The packet contains:
 - \[Optional\] If secret data is encrypted (string-to-key usage octet not zero), an Initial Vector (IV) of the same l
ength as the cipher's block size.
 
 - Only for a version 5 packet, a four-octet scalar octet count for the following secret key material.
-  This includes the encrypted SHA-1 hash or AEAD tag if the string-to-key usage octet is 254 or 253.
+  This includes the encrypted SHA-1 hash if the string-to-key usage octet is 254.
 
 - Plain or encrypted multiprecision integers comprising the secret key data.
   This is algorithm-specific and described in section {{algorithm-specific-parts-of-keys}}.