Skip to content

der: error on nested trailing data - #2401

Merged
tarcieri merged 2 commits into
masterfrom
der/restore-finished-check
Aug 22, 2026
Merged

der: error on nested trailing data#2401
tarcieri merged 2 commits into
masterfrom
der/restore-finished-check

Conversation

@tarcieri

Copy link
Copy Markdown
Member

This fixes a regression introduced in #2378 which would silently ignore trailing data inside of nested DER messages.

Closes#2391

This fixes a regression introduced in #2378 which would silently ignore
trailing data inside of nested DER messages.
Closes#2391
Comment threadder/src/reader/slice.rs Outdated
Co-authored-by: dishmaker <141624503+dishmaker@users.noreply.github.com>
@tarcieri
tarcieri merged commit 283d836 into masterAug 22, 2026
117 checks passed
@tarcieri
tarcieri deleted the der/restore-finished-check branch August 22, 2026 13:26
@karalabe

Copy link
Copy Markdown

Any chance of cutting a release with this one? Kind of borks the latest release.

karalabe added a commit to dark-bio/crypto-rs that referenced this pull request Aug 28, 2026
This PR fixes a DER decoding issue that worked until now, just used the
wrong types. That ended up hitting a regression in the upstream `der`
crate (RustCrypto/formats#2401), causing an
invalid decode. Whilst the upstream fix would also hide this issue, this
PR also resolves it differently too by using non-nested types.
Apart of that, it also adds some extra validation to ensure certain DER
items ignored until now get flat out rejected.
Sign up for freeto 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.

der: read_nested may no longer require complete consumption of nested content

3 participants

@tarcieri@karalabe@dishmaker