Repository navigation
restrict embedding to embeddable signature types - #325
Conversation
|
I proposed something with similar effect here: https://datatracker.ietf.org/doc/html/draft-gallagher-openpgp-signatures#name-recursive-embedding-inside- It differs from this patch by classifying signature types as "embeddable" and "non-embeddable" and then only permits embeddable signature types to be embedded in non-embeddable types, thus preventing infinite recursion without counting nesting. |
f9a6868 to
4a1fbbd
Compare
|
good catch, thanks for the link. reworked it to follow that model - an embedded signature must be an embeddable type, and embeddable types can't themselves carry an embedded signature, so the recursion gets rejected while parsing the inner sig without counting depth. pushed an update |
|
Hi 👋 Thanks for the PR! However, this is now somewhat conflating adding (partial) support for the Third-Party Confirmation signature type, and fixing the original issue you pointed out. Since we don't support Third-Party Confirmation signatures for now, we can just check that the embedding signature is not a Primary Key Binding signature and call it a day, IMHO. |
|
To be fully effective, it needs two checks:
|
|
Yeah, but the second one we already have: go-crypto/openpgp/packet/signature.go Lines 673 to 675 in 0c1128b |
|
Aha, I didn't understand what you meant by "embedding signature". Yes, agreed. 🫣 |
|
hmm, makes sense. give me a few minutes, i'll try cutting it down to just that check |
|
pushed. just the primary key binding check now, dropped the third-party confirmation bits and left the existing embedded-type check alone |
4a1fbbd to
9398663
Compare
9398663 to
8fe6e4b
Compare
An embedded signature can itself carry an embedded signature, allowing unbounded recursion during parsing. This rejects nesting beyond one level.