ProtonMail / go-crypto

Fork of go/x/crypto, providing an up-to-date OpenPGP implementation
https://pkg.go.dev/github.com/ProtonMail/go-crypto
BSD 3-Clause "New" or "Revised" License
328 stars 99 forks source link

Allow empty Key Flags subpackets #214

Closed twiss closed 1 month ago

twiss commented 1 month ago

Allow parsing empty Key Flags subpackets.

This is allowed by the spec, which says:

This subpacket contains a list of binary flags that hold information about a key. It is a string of octets, and an implementation MUST NOT assume a fixed size. This is so it can grow over time. If a list is shorter than an implementation expects, the unstated flags are considered to be zero.

And it can be useful to explicitly say that a primary key is not allowed to be used for any purpose (except certifying subkeys), for example.