sks-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Sks-devel] Question about key hash calculation


From: Jason Harris
Subject: Re: [Sks-devel] Question about key hash calculation
Date: Sun, 8 Sep 2013 19:02:02 -0400
User-agent: Mutt/1.5.21 (2010-09-15)

On Sun, Sep 08, 2013 at 04:52:09PM -0500, Casey Marshall wrote:
> Hi,
> Hockeypuck compatibility with SKS is getting very close! I'm just working

Excellent!

> through key parsing & hashing differences so that recon will converge on
> the same keys.
> 
> For most keys, I am able to reproduce the same hash calculation as SKS in
> Hockeypuck, but there are a few keys which I'm having trouble with. It
> might be something in common I'm missing, so I'll choose one in particular
> to start:
> 
> http://pool.sks-keyservers.net/pks/lookup?op=vindex&search=0x00160490f519d45df82977aaafb8b57e252b8b37&hash=on
> 
> This key has "duplicate" V4 signature packets which contain the same hashed
> material and signature MPIs, but there are different unhashed subpackets,
> so the raw packet contents come out different.

That SKS is storing (and hashing) both packets means that hockeypuck
must store and hash both packets as well - at least for purposes of
gossip/synchronization.

If you want to strip the duplicate packet for normal clients, i.e.,
not during a /hashquery, that should be OK.

> I haven't been able to come up with the same result as SKS for this
> particular key using the method I ported from SKS (with sorted packets by
> packet type, then by byte content, write the packet type, length and
> content to the digest). What processing might I be missing on this key?

Every packet SKS stores and sends to you needs to be stored and hashed,
even duplicate and undecodable/unintelligible ones.

> I'd also like to understand where & how SKS performs self-signature
> verification. I've tried uploading public keys containing spoofed UIDs with
> a signature not made by the public key but by some other key and SKS
> properly rejects it. ParsePGP.good_signature looks like it just parses the
> material, as far as I can tell.

Maybe fixkey.ml is doing that with:

    let selfsigs = drop_bad_sigs pkey.selfsigs in

where:

let drop_bad_sigs packlist =
  List.filter ~f:good_signature packlist

and:

let good_signature pack =
  try ignore (ParsePGP.parse_signature pack); true
  with e -> false

using ParsePGP.parse_signature found in parsePGP.ml.  However, I don't
detect any validation happening other than making sure the packet can
be fully unpacked/understood.

-- 
Jason Harris           |  PGP:  This _is_ PGP-signed, isn't it?
address@hidden _|_ Got photons? (TM), (C) 2004

Attachment: pgpHdSZ5AkkBs.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]