Fix DTLS 1.3 extSz out-of-bounds and word16 truncation on oversized certificate chains#10103
Open
gasbytes wants to merge 1 commit intowolfSSL:masterfrom
Open
Fix DTLS 1.3 extSz out-of-bounds and word16 truncation on oversized certificate chains#10103gasbytes wants to merge 1 commit intowolfSSL:masterfrom
gasbytes wants to merge 1 commit intowolfSSL:masterfrom
Conversation
7cf8fea to
a30c6af
Compare
rizlik
requested changes
Mar 30, 2026
src/dtls13.c
Outdated
| ssl->dtls13FragmentsBuffer.buffer + ssl->dtls13FragOffset, | ||
| fragLength); | ||
|
|
||
| if ((word32)outputSz > WOLFSSL_MAX_16BIT) { |
Contributor
There was a problem hiding this comment.
move it just after outputSz is computed
src/dtls13.c
Outdated
|
|
||
| seq = ssl->dtls13EncryptEpoch->nextSeqNumber; | ||
|
|
||
| if ((word32)sendSz > WOLFSSL_MAX_16BIT) { |
Contributor
There was a problem hiding this comment.
move it just after sendSz is computed
a30c6af to
fcd454f
Compare
fcd454f to
a9ff710
Compare
rizlik
previously approved these changes
Mar 30, 2026
julek-wolfssl
previously approved these changes
Mar 31, 2026
a9ff710 to
5ae6a9d
Compare
|
Thanks for the fix, @gasbytes. I'm the original reporter (zd#21435). Reviewed the changes:
LGTM. Thanks for the thorough fix and test. |
Contributor
Author
|
retest this please |
5ae6a9d to
8e35a14
Compare
Contributor
|
only failing test is something in the multi-test PRB (logs lost) |
douzzer
requested changes
Apr 3, 2026
Contributor
douzzer
left a comment
There was a problem hiding this comment.
[clang-tidy-asn-template-sp-all-small-stack] [51 of 52] [5a573e0c76]
configure with clang-tidy... real 0m12.984s user 0m7.858s sys 0m6.142s
build.../tmp/tmp.4346_28411/wolfssl_test_workdir.32702/wolfssl/tests/api/test_dtls.c:2840:9: warning: the value returned by this function should not be disregarded; neglecting it may lead to errors [bugprone-unused-return-value]
2840 | XFSEEK(f, 0, XSEEK_END);
| ^
./wolfssl/wolfcrypt/wc_port.h:1165:24: note: expanded from macro 'XFSEEK'
1165 | #define XFSEEK fseek
| ^
/tmp/tmp.4346_28411/wolfssl_test_workdir.32702/wolfssl/tests/api/test_dtls.c:2840:9: note: cast the expression to void to silence this warning
2840 | XFSEEK(f, 0, XSEEK_END);
| ^
./wolfssl/wolfcrypt/wc_port.h:1165:24: note: expanded from macro 'XFSEEK'
1165 | #define XFSEEK fseek
| ^
/tmp/tmp.4346_28411/wolfssl_test_workdir.32702/wolfssl/tests/api/test_dtls.c:2842:9: warning: the value returned by this function should not be disregarded; neglecting it may lead to errors [bugprone-unused-return-value]
2842 | XFSEEK(f, 0, XSEEK_SET);
| ^
./wolfssl/wolfcrypt/wc_port.h:1165:24: note: expanded from macro 'XFSEEK'
1165 | #define XFSEEK fseek
| ^
/tmp/tmp.4346_28411/wolfssl_test_workdir.32702/wolfssl/tests/api/test_dtls.c:2842:9: note: cast the expression to void to silence this warning
2842 | XFSEEK(f, 0, XSEEK_SET);
| ^
./wolfssl/wolfcrypt/wc_port.h:1165:24: note: expanded from macro 'XFSEEK'
1165 | #define XFSEEK fseek
| ^
Suppressed 41 warnings (32 in non-user code, 9 NOLINT).
real 0m14.533s user 3m43.584s sys 0m12.986s
clang-tidy reported defects in 1 file(s).
Contributor
Author
|
Jenkins retest this please (logs lost) |
…ertificate chains
8e35a14 to
1653ecd
Compare
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.
Description
Fix DTLS 1.3 extSz out-of-bounds and word16 truncation on oversized certificate chains.
Fixes zd#21435
Testing
added test_dtls13_oversized_cert_chain that exercises the appropriate code pathss
Checklist