x/crypto/openpgp: Cannot encrypt when subkey has no key flags specified #32464
Labels
FrozenDueToAge
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I have been given a PGP public key by a third party where the sub-key signature contains no key flag sub-packet (see FRC 4880 5.2.3.21).
When the key flag sub-packet is missing the current implementation of
x/crypto/openpgp
assumes that the key shouldn't be used for anything. I've not been able to find anything in the OpenPGP spec that defines how this case should be handled, but I believe the GnuPG implementation assumes the key can be used for all of its capabilities.I've omitted the actual public key in the above snippet to preserve the privacy of the third party I am working with. I am admittedly not an expert, but I have not had any luck generating a test key that has the key usage subpacket omitted.
What did you expect to see?
The encrypted output.
What did you see instead?
The text was updated successfully, but these errors were encountered: