Repository navigation
Conversation
Exercise UTF8 continuation bytes directly instead of depending on a later flexi-parser error. Fixes: libtom#561 Co-authored-by: generaltony007 <144252170+GeneralTony007@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes: #561
The existing #507 flexi-parser vector still reports an error when the UTF8 fix is removed, because parsing fails later for an unrelated reason. Add a direct
der_decode_utf8_string()regression so that failure cannot hide acceptance of an invalid leading continuation byte.The test checks all leading bytes from
0x80through0xbf, each followed by another continuation byte, and also checks the originalbf bfUTF8 payload. The DER length and output buffer are sufficient for the old decoder to accept the pair, so the expectedCRYPT_INVALID_PACKETtests the invalid leading byte rather than truncation or output capacity. The existing flexi-parser vector stays unchanged. No production code changes.Validation on Linux with LibTomMath:
-Werrorfull suite: 30 passed, 0 failed, 1 nop.This adds coverage for the UTF8 portion of #507. It does not change the flexi-parser underflow handling discussed in #561.
Checklist
Fixes:tag to the commit message