Issue parsing version-prefixed fingerprints in packets
We have at least two packets (PKESKv6 and OPSv6) that have 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 signature subpackets are also affected, but there we have the subpacket framing.)
-
In the case of the OPS packet, the fingerprint field is the only field with a variable size, so this is no issue there.
-
In the case of the PKESK field, there is a second variable size field in the packet: 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 OPSv6 packets is annoying and parsing PKESKv6 packets is impossible.
One really easy way to fix this is to assume that v4 fingerprints are 160 bits, and every other fingerprint is 256 bits, and if that assumption turns out to be false, let the parsing fail. We could even make that robust if we commit to only ever use keys with fingerprints of 256 bits with these packet versions in the future.