ECC: blind private key after use in signing#7416
Merged
dgarske merged 2 commits intowolfSSL:masterfrom May 14, 2024
Merged
Conversation
e06c022 to
361dc0b
Compare
19a2d86 to
3c79312
Compare
dgarske
requested changes
May 13, 2024
Member
dgarske
left a comment
There was a problem hiding this comment.
Have you checked code size and performance impact with the new options?
Member
There was a problem hiding this comment.
Please document WOLFSSL_BLIND_PRIVATE_KEY and WOLFSSL_ECC_BLIND_K at the top of ecc.c.
Member
There was a problem hiding this comment.
Is unsigned int the right type here? Should it be sp_digit or sp_int_digit?
Contributor
Author
There was a problem hiding this comment.
'i' is only used as an index.
It shouldn't be sp_int_digit.
Member
There was a problem hiding this comment.
Please add WOLFSSL_LOCAL or WOLFSSL_API to these....
$./configure CFLAGS="-DWOLFSSL_ECC_BLIND_K -DWOLFSSL_BLIND_PRIVATE_KEY" && make
...
/usr/bin/ld: wolfcrypt/test/test.o: in function `ecc_def_curve_test':
test.c:(.text+0x1ae8): undefined reference to `ecc_get_k'
/usr/bin/ld: test.c:(.text+0x1af4): undefined reference to `ecc_get_k'
/usr/bin/ld: test.c:(.text+0x1b00): undefined reference to `ecc_get_k'
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:6196: wolfcrypt/test/testwolfcrypt] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: Leaving directory '/home/davidgarske/GitHub/wolfssl'
make[1]: *** [Makefile:8391: check-recursive] Error 1
make[1]: Leaving directory '/home/davidgarske/GitHub/wolfssl'
make: *** [Makefile:8860: check] Error 2
Use a mask to blind the private key after use so that stored private key is always changing.
When WOLFSSL_BLIND_PRIVATE_KEY is defined, blind the private key DER encoding so that stored private key data is always changing.
Contributor
Author
|
retest this please |
dgarske
approved these changes
May 14, 2024
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
Use a mask to blind the private key after use so that stored private key is always changing.
Fixes zd#17783
Testing
./configure '--disable-shared' 'CFLAGS=-DWOLFSSL_ECC_BLIND_K'
Checklist