Skip to content

Make it possible to parse arbitrary PKESKv6 packets.

Justus Winter requested to merge justus/robust-packet-parsing into main

The PKESKv6 packet has a fingerprint field that is prefixed with the key version. Unfortunately that means that if you don't know the key version, you don't know how long the fingerprint field is.

The PKESKv6 packet has a second variable size field: the encrypted ciphertext. If you don't know the public key algorithm used, then you cannot know the ciphertexts size or structure.

That means that in general, parsing PKESKv6 packets is impossible.

Fix this by introducing an explicit length octet for the fingerprint. This length also covers the key version number. This has the advantage of nicely covering the anonymous recipient case, where a zero length indicates not having a fingerprint in the packet without having to resort to a fictitious key version zero.

(This is also analogous to how the signature subpacket length of the issuer fingerprint covers both the key version octet and the fingerprint.)

Fixes #166 (closed).

This also harmonizes v6 one-pass-signature packets.

Includes and hence obsoletes (or depends upon) !302 (merged).

Merge request reports