Re: [openpgp] calculating PGP signature on a public key

Clint Adams <clint@debian.org> Mon, 30 July 2012 20:59 UTC

Return-Path: <clint@debian.org>
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 3877C11E818E for <openpgp@ietfa.amsl.com>; Mon, 30 Jul 2012 13:59:52 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.6
X-Spam-Level:
X-Spam-Status: No, score=-2.6 tagged_above=-999 required=5 tests=[BAYES_00=-2.599, NO_RELAYS=-0.001]
Received: from mail.ietf.org ([12.22.58.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 1p9B3GkKzDtv for <openpgp@ietfa.amsl.com>; Mon, 30 Jul 2012 13:59:51 -0700 (PDT)
Received: from thumb.scru.org (unknown [IPv6:2001:470:a807::1]) by ietfa.amsl.com (Postfix) with ESMTP id AE21111E81C5 for <openpgp@ietf.org>; Mon, 30 Jul 2012 13:59:51 -0700 (PDT)
Received: by thumb.scru.org (Postfix, from userid 1000) id 6B716104EE; Mon, 30 Jul 2012 20:59:49 +0000 (UTC)
Date: Mon, 30 Jul 2012 20:59:49 +0000
From: Clint Adams <clint@debian.org>
To: George Lind <glind98@gmail.com>
Message-ID: <20120730205949.GA24997@scru.org>
References: <CAOfLfKxJ-1=zk_Fdk8vzWCbGRB0yNrFOfgWvxA4B3Wn16yi+cQ@mail.gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <CAOfLfKxJ-1=zk_Fdk8vzWCbGRB0yNrFOfgWvxA4B3Wn16yi+cQ@mail.gmail.com>
User-Agent: Mutt/1.5.20 (2009-06-14)
Cc: openpgp@ietf.org
Subject: Re: [openpgp] calculating PGP signature on a public key
X-BeenThere: openpgp@ietf.org
X-Mailman-Version: 2.1.12
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: <http://www.ietf.org/mail-archive/web/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: Mon, 30 Jul 2012 20:59:52 -0000

On Mon, Jul 30, 2012 at 04:15:11PM -0400, George Lind wrote:
> I am trying to figure out from the RFC exactly which fields get hashed when
> calculating the public key signature.

You'll want RFC4880 §5.2.4.  If you are actually talking about a signature
over a public key, you just want the literal 0x99, the two-octet length
of the key, and the body of the key packet.

Perhaps you are conflating several different signature types into one.

> The public key including the packet header and body
> The user id including the packet header and body
> signature version
> signature type
> public key algorithm
> hashing algorithm
> length of the hashed subpackets
> all the hashed subpackets
> 
> Can anyone confirm if these are correct?