Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow empty Key Flags subpackets #214

Merged
merged 1 commit into from
Jul 8, 2024
Merged

Allow empty Key Flags subpackets #214

merged 1 commit into from
Jul 8, 2024

Conversation

twiss
Copy link
Member

@twiss twiss commented Jul 8, 2024

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.

@twiss twiss requested a review from lubux July 8, 2024 13:00
Copy link
Contributor

@lubux lubux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -518,11 +518,10 @@ func parseSignatureSubpacket(sig *Signature, subpacket []byte, isHashed bool) (r
}
case keyFlagsSubpacket:
// Key flags, section 5.2.3.21
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not for this MR but rather for a future refactor. I noticed that RFC4880 has different sections than the crypto-refresh. Thus, it can be a bit confusing to reference sections in the doc comments.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I agree. In general we should update all the references once RFC9580 comes out.

@twiss twiss merged commit 196c8f5 into main Jul 8, 2024
8 checks passed
@twiss twiss deleted the allow-empty-keyflags branch July 8, 2024 13:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants