-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Fix ssl_context_info.c to correctly check for EOF - type-limit bug #3449
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Bugfix | ||
* read_next_b64_code() isn't correctly checking against EOF because it checks against 'char' rather than 'int'. This is identified via type-limit warning reported by gcc. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please word changelog entries for users of the libraries, not for maintainers. |
||
Reported and fix contributed by naynajain in #3449. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -400,7 +400,12 @@ run_test "Wrong base64 format" \ | |
"def_bad_b64.txt" \ | ||
-m "ERROR" \ | ||
-u "The length of the base64 code found should be a multiple of 4" \ | ||
-n "bytes left to analyze from context" | ||
-n "bytes left to analyze from context" \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There shouldn't be a trailing backslash here since there is no continuation line. |
||
|
||
run_test "EOF base64 format" \ | ||
"def_bad_b64_eof.txt" \ | ||
-m "Finished. No valid base64 code found" \ | ||
-n "ERROR" \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There shouldn't be a trailing backslash here since there is no continuation line. |
||
|
||
run_test "Too much data at the beginning of base64 code" \ | ||
"def_b64_too_big_1.txt" \ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/w== | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There's no “EOFish” character (byte 0xff) here. This is a well-formed file containing Base64 data. The encoded data isn't a valid SSL context. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Thanks for your review. And yes, it is not a valid SSL Context. It is just meant to represent EOF to test that it can be interpreted correctly by read_next_b64_code() function. Am I missing something ? Thanks & Regards, There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The bug was in the parsing of the base64-encoded, not in the handling of the decoded data. So the fact that the decoded data contains a 0xff is irrelevant. What matters is when the file itself contains a 0xff. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please format changelog entries to 80 columns.