[openpgp] [PATCH] Specify eight-octet lengths for V5 signatures

"brian m. carlson" <sandals@crustytoothpaste.net> Tue, 14 February 2017 01:13 UTC

Return-Path: <sandals@crustytoothpaste.net>
X-Original-To: openpgp@ietfa.amsl.com
Delivered-To: openpgp@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 92DE61294B3 for <openpgp@ietfa.amsl.com>; Mon, 13 Feb 2017 17:13:44 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.001
X-Spam-Level:
X-Spam-Status: No, score=-2.001 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (3072-bit key) header.d=crustytoothpaste.net
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 89fyUiQK2smV for <openpgp@ietfa.amsl.com>; Mon, 13 Feb 2017 17:13:43 -0800 (PST)
Received: from castro.crustytoothpaste.net (sandals-1-pt.tunnel.tserv8.dal1.ipv6.he.net [IPv6:2001:470:1f0e:3f1::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id EAC03129506 for <openpgp@ietf.org>; Mon, 13 Feb 2017 17:13:42 -0800 (PST)
Received: from genre.crustytoothpaste.net (unknown [IPv6:2001:470:b978:101:254c:7dd1:74c7:cde0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by castro.crustytoothpaste.net (Postfix) with ESMTPSA id C072C280AD for <openpgp@ietf.org>; Tue, 14 Feb 2017 01:13:41 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=crustytoothpaste.net; s=default; t=1487034821; bh=Zzgf0345SmuHajy7HSvOLmDk0Eyl1EESvUO6qoNW0f4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=OkZAmx/GHjYHGVxWqLyVxciVkXLb61aNfgyplnomIKGTihLGOjhnvGvFXu64vBCxX Clt0IE+FKvH5kR61qJtGt8K4GJJQqqwwMCgrqiNa0DYHdFf+2VlFKN90t+HAFM7XNs +iRLqjhOWG8YW/Z/BNXzCJpcwog1DbKVK//TBrt7kqXpUmbiEspVHYjcmSjkVpCliW +K8Uwq4r255relIT2tXo7OUm95iSiIJ2Jx38bbmOnqCk97gzuqEvR5ZL+/wP0zWEq7 8iGFqmgHjEqCWNt6vjXzz8FoNGoFOxZmWWgJeJdb85ck6buqWiuY+E0hftHPkiwhcl Pxkdw42aCTj5WR+rOovCQtCrKv+x6ozprNBrsNN5kd4ytB+NymfpOf0gEqgNPipW6x b2wBQbWYYE2g7xnvEMmkloV3GGBlKuzSFnPyKkDZTTE++cwJ4wk262c1yk+oQTQeaq XlJi+M44pKmRIJaABno9oH6E6MN8Njv1wqIXFJkoWm9AenYlsY8
From: "brian m. carlson" <sandals@crustytoothpaste.net>
To: openpgp@ietf.org
Date: Tue, 14 Feb 2017 01:13:32 +0000
Message-Id: <20170214011332.839171-1-sandals@crustytoothpaste.net>
X-Mailer: git-send-email 2.11.0
In-Reply-To: <20170213005928.2ytmjp3h2njyjcgy@genre.crustytoothpaste.net>
References: <20170213005928.2ytmjp3h2njyjcgy@genre.crustytoothpaste.net>
Archived-At: <https://mailarchive.ietf.org/arch/msg/openpgp/w9y7xb0Dmyr4aC8_RWq3ycCTdYk>
Subject: [openpgp] [PATCH] Specify eight-octet lengths for V5 signatures
X-BeenThere: openpgp@ietf.org
X-Mailman-Version: 2.1.17
Precedence: list
List-Id: "Ongoing discussion of OpenPGP issues." <openpgp.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/openpgp>, <mailto:openpgp-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/openpgp/>
List-Post: <mailto:openpgp@ietf.org>
List-Help: <mailto:openpgp-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/openpgp>, <mailto:openpgp-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 14 Feb 2017 01:13:44 -0000

---
 middle.mkd | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/middle.mkd b/middle.mkd
index 5182c7d..96be061 100644
--- a/middle.mkd
+++ b/middle.mkd
@@ -1654,7 +1654,7 @@ first the primary key and then the subkey being revoked.
 A certification signature (type 0x10 through 0x13) hashes the User ID
 being bound to the key into the hash context after the above data. A
 V3 certification hashes the contents of the User ID or attribute
-packet packet, without any header. A V4 certification hashes the
+packet packet, without any header. A V4 or V5 certification hashes the
 constant 0xB4 for User ID certifications or the constant 0xD1 for User
 Attribute certifications, followed by a four-octet number giving the
 length of the User ID or User Attribute data, and then the User ID or
@@ -1671,7 +1671,7 @@ unhashed subpacket data length value is set to zero.
 Once the data body is hashed, then a trailer is hashed. A V3 signature
 hashes five octets of the packet body, starting from the signature
 type field.  This data is the signature type, followed by the
-four-octet signature time. A V4 signature hashes the packet body
+four-octet signature time. A V4 or V5 signature hashes the packet body
 starting from its first field, the version number, through the end of
 the hashed subpacket data.  Thus, the fields hashed are the signature
 version, the signature type, the public-key algorithm, the hash
@@ -1683,6 +1683,11 @@ big-endian number that is the length of the hashed data from the
 Signature packet (note that this number does not include these final
 six octets).
 
+V5 signatures instead hash in a ten-octet trailer: the version of the
+Signature packet, i.e., 0x05; 0xFF; and an eight-octet, big-endian
+number that is the length of the hashed data from the Signature packet
+(note that this number does not include these final ten octets).
+
 After all this has been hashed in a single hash context, the resulting
 hash field is used in the signature algorithm and placed at the end of
 the Signature packet.
-- 
2.11.0