-
Notifications
You must be signed in to change notification settings - Fork 28
rsa pki encoding/decoding tests and fix for encoding rsapss to pki #333
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
base: master
Are you sure you want to change the base?
rsa pki encoding/decoding tests and fix for encoding rsapss to pki #333
Conversation
SparkiDev
left a comment
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.
Why does wp_rsa_import have a parameter with a string that is the wrong name form?
We have places we set mdName to something explicitly and they can be changed but the import should be the same as
test/test_rsa.c
Outdated
| static int test_rsa_encode_pkcs8_evp_pkey(const unsigned char *p, long len) | ||
| { | ||
| int err = 0; | ||
| PKCS8_PRIV_KEY_INFO* p8inf1; |
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.
Initialise these four pointer.
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.
Now initialized to NULL
| case WC_HASH_TYPE_SHA3_384: | ||
| case WC_HASH_TYPE_SHA3_512: | ||
| case WC_HASH_TYPE_BLAKE2B: | ||
| case WC_HASH_TYPE_BLAKE2S: |
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.
Missing SHA512-224 and SHA512-256
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.
Added both types and several others. Wrapped new additions in ifdef's
src/wp_rsa_kmgmt.c
Outdated
| { | ||
| int ok = 1; | ||
| OSSL_PARAM* p; | ||
| const char *ossl_digest; |
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.
Initialise to NULL.
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.
Initalized to NULL and changed name to osslDigest
5b5c753 to
4807359
Compare
comment seems cut off so I took my best guess. I didn't do anything to As for why this functions exists: When you get parameters from wolfProvider the md and mgf should match what OpenSSL uses for their digest names. I didn't edit what the md and mgf were set to in wolfProvider since it seems like that could cause issues in wolfCrypt (though I'm not certain). |
4807359 to
e32456b
Compare
This mainly contains testing for encoding / decoding RSA and RSASSA-PSS keys to / from pki.
Found some bugs and fixed them:
Addendum:
test_rsa_decode_pkcs8_evp_pkeyto allow decoding ctx to be specified. Now decoding can be done with ossl and wp, or just ossl.