Repository navigation
Anchor FP ECC cache entries to a and modulus. Avoid writing partial blocks in AES-NI assembly. Ensure that the top bit is masked/rejected throughout curve25519 functions. Enable WOLFSSL_AES_CBC_LENGTH_CHECKS by default. - #11852
kareem-wolfssl wants to merge 8 commits into
Conversation
|
@claude review |
|
34c1ea2 to
22e0970
Compare
7ebe175 to
1391188
Compare
| /* The whole final block is read and only the | ||
| * remaining bytes are written. */ | ||
| if ((ret == 0) && (rem > 0)) { | ||
| ret = wc_AesCbcDecrypt(aes, blk, in + whole, sizeof(blk)); |
There was a problem hiding this comment.
I think this tries to read a whole 16 bytes from (in + whole) when there is not 16 bytes left to read? The encryption process above could be similar type of issue where it tries to write a 16 byte block to (out + whole) when out+whole does not have 16 bytes of room left.
There was a problem hiding this comment.
Fixed, went back to just rejecting partial blocks for decrypt, while still allowing partial (zero padded) blocks for encrypt.
The intention of this is to match OpenSSL's behavior, but I can revert the partial block encryption change as well if desired.
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #11852
Scan targets checked: wolfcrypt-src, wolfcrypt-bugs, wolfssl-src, wolfssl-bugs
Not reviewed (no scan target covers them): CMakeLists.txt, configure.ac, tests/api/test_ecc.h
Coverage: 10 of 10 in-scope changed file(s) opened by the reviewer
Findings: 1
1 finding(s) posted as inline comments (see file-level comments below)
This review was generated automatically by Fenrir. Reported findings require changes before merge.
Review tier: Max
…em across different curves. This is using the 0th entry in the LUT to store the a/modulus, as this entry is currently left empty. Add tests, including whitebox test. Thanks to Anthropic for the report.
Enable WOLFSSL_AESCBC_LENGTH_CHECKS by default. This option is low cost and provides defence in depth. Thanks to Anthropic for the report.
…SL_X25519_NO_MASK_PEER) throughout curve25519 functions, as per RFC 7748 section 5. Thanks to Anthropic for the report.
…ibility. Always copy curve255519 point before masking to avoid modifying argument. Add LTC Curve25519 masking.
…hey don't actually implement it, it causes test failures.
c2c7aa8 to
17864a9
Compare


Description
Partially fixes zd#22448
Testing
Built-in + added tests
Checklist