Skip to content

Negative test case for constructed, definite-length octet string #1931

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

Merged

Conversation

dwhjames
Copy link
Contributor

@dwhjames dwhjames commented Jul 9, 2025

Ensure octet strings with constructed, definite-length method return an error, rather than an incorrect decoding.

@dwhjames
Copy link
Contributor Author

dwhjames commented Jul 9, 2025

@tarcieri @dishmaker,

This is incomplete, but here’s an attempt at ensuring that constructed, definite-length method encoded octet strings are detected and rejected.

Seeking feedback; I made a few attempts but finally realized what you, @dishmaker, meant by your comment

As the Length struct was updated

I thought it might be fair game to draft a change to the Header struct

@dwhjames dwhjames force-pushed the constructed_definite_octet_string branch from 94e1198 to 78a3118 Compare July 9, 2025 22:37
@tarcieri
Copy link
Member

tarcieri commented Jul 9, 2025

Propagating the original constructed bit through the Header sounds good to me

@dwhjames dwhjames force-pushed the constructed_definite_octet_string branch from 78a3118 to 544e397 Compare July 9, 2025 23:26
@dwhjames dwhjames marked this pull request as ready for review July 9, 2025 23:32
@dwhjames dwhjames force-pushed the constructed_definite_octet_string branch from 544e397 to 0c5789e Compare July 11, 2025 04:57
@dwhjames dwhjames force-pushed the constructed_definite_octet_string branch 2 times, most recently from fa5700c to 0d37f57 Compare July 23, 2025 04:49
dwhjames added 2 commits July 22, 2025 21:51
Ensure octet strings with constructed, definite-length method
return an error, rather than an incorrect decoding.
@dwhjames dwhjames force-pushed the constructed_definite_octet_string branch from 0d37f57 to 86da1ac Compare July 23, 2025 04:51
@dwhjames dwhjames requested a review from tarcieri July 23, 2025 17:41
@tarcieri tarcieri merged commit 858f3af into RustCrypto:master Jul 31, 2025
173 checks passed
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