Small stack compress -- 3000line reduction#9153
Conversation
|
Can one of the admins verify this patch? |
|
Okay to test. Contributor agreement on file. |
888c896 to
74a3a21
Compare
|
please retest. fixed an error picked up in CI |
|
hmmm, what's happened in the failing test? |
All of the FIPS 140-3 tests are failing. You'd have to get the fips-ready bundle and build it with the --enabe-fips=ready option to reproduce. But hopefully you can spot it with the compile error: |
|
my changes to i've got the fips-ready zip and can can you share the steps to |
can you please send me the script that fails so i can reproduce? |
|
Jenkins retest this please. History lost. @effbiae I'll work on trying to provide you a way to reproduce, but it might not be possible. In fips and self test modes it uses an older snapshot of the wolfCrypt code. |
48fc818 to
d700c1b
Compare
|
i reduced my impact on wolfssl/wolfcrypt/types.h -- is PRB-master-job still failing on FIPS tests? |
|
Jenkins retest this please |
dgarske
left a comment
There was a problem hiding this comment.
This is a great refactor!
Not a critical issue, but we prefer a 80 character limit:
overlong lines added:
src/internal.c:15902 WC_FREE_VAR_EX(dCertAdd, ssl->heap, DYNAMIC_TYPE_TMP_BUFFER);
src/internal.c:33148 WC_DECLARE_VAR(encodedSig, byte, MAX_ENCODED_SIG_SZ, 0);
src/internal.c:33165 WC_FREE_VAR_EX(encodedSig, ssl->heap, DYNAMIC_TYPE_SIGNATURE);
src/internal.c:39038 WC_FREE_VAR_EX(encodedSig, ssl->heap, DYNAMIC_TYPE_SIGNATURE);
wolfcrypt/src/pkcs7.c:4446 WC_FREE_VAR_EX(digest, pkcs7->heap, DYNAMIC_TYPE_TMP_BUFFER);
wolfcrypt/src/pkcs7.c:4561 WC_FREE_VAR_EX(pkcs7Digest, pkcs7->heap, DYNAMIC_TYPE_TMP_BUFFER);
wolfcrypt/src/pkcs7.c:4574 WC_FREE_VAR_EX(pkcs7Digest, pkcs7->heap, DYNAMIC_TYPE_TMP_BUFFER);
wolfcrypt/src/pkcs7.c:4587 WC_FREE_VAR_EX(pkcs7Digest, pkcs7->heap, DYNAMIC_TYPE_TMP_BUFFER);
wolfcrypt/src/pkcs7.c:10166 WC_FREE_VAR_EX(serialNum, pkcs7->heap, DYNAMIC_TYPE_TMP_BUFFER);
wolfcrypt/src/pkcs7.c:10344 WC_FREE_VAR_EX(privKey, pkcs7->heap, DYNAMIC_TYPE_TMP_BUFFER);
[...and more...]
d700c1b to
f7b2119
Compare
thanks, i like being useful :)
fixed, thanks! what happened in PRB-master-job? |
|
Jenkins retest this please. Some tests failed with "AgentOfflineException" and another "RequestAbortedException" |
f7b2119 to
b4255b5
Compare
|
Jenkins retest this please. History lost |
|
retest this please |
b4255b5 to
6b287f0
Compare
There was a problem hiding this comment.
This looks really good.
cppcheck discovered one new defect, easy to fix:
src/ssl.c:5916:19: warning: Either the condition 'cert==((void*)0)' is redundant or there is possible null pointer dereference: cert. [nullPointerRedundantCheck]
subjectHash = cert->extSubjKeyId;
^
src/ssl.c:5892:14: note: Assuming that condition 'cert==((void*)0)' is not redundant
if (cert == NULL) {
^
src/ssl.c:5916:19: note: Null pointer dereference
subjectHash = cert->extSubjKeyId;
^
It's definitely a false positive -- your WC_ALLOC_VAR_EX() does the right thing -- but cppcheck isn't grokking the expanded macro there (common failure mode for that tool, alas). You can fix it by passing an empty failure expression to your new macro, and right after, explicitly checking for and returning failure on null, as in the incumbent code.
Note the line numbers are after rebasing the PR on current master.
|
Note there's also some indentation flubs after your Python script had its way with the source -- worth cleaning up. |
6b287f0 to
b5c5854
Compare
hopefully fixed.
i've looked through the diffs again but couldn't pick up anything |
ah, i think i know what you mean. david picked it up too, but let it through. have manually edited the few cases. |
|
Jenkins retest this please |
|
Jenkins retest this please. FIPS v2 |
|
Jenkins retest this please: "fipsv2-OE-ready" -> Error: OE2: without PAA test failed. This is an recurring intermittent issue. |
Description
There are many lines of small stack conditional compiles (
#ifdef WOLFSSL_SMALL_STACK) that have been compressed to fewer lines using the macros in./wolfssl/wolfcrypt/types.h. This work was automated with a python script and reduces the code base by 3000 lines. The first commit is the result of the script and subsequent commits are hand edits.I added two macros to
./wolfssl/wolfcrypt/types.h:WC_ALLOC_VAR_EXto take 2 extra parametersWC_FREE_VAR_EXto take 1 extra parameterTesting
Checklist