Compatibility layer additions for X.509 extensions and RSA PSS#8897
Compatibility layer additions for X.509 extensions and RSA PSS#8897JacobBarthelmeh merged 2 commits intowolfSSL:masterfrom
Conversation
|
These features expect the following configuration: |
|
Jenkins retest this please.
|
3daca2b to
6e41347
Compare
|
Jenkins retest this please |
|
Jenkins retest this please Found unhandled org.jenkinsci.plugins.workflow.support.steps.AgentOfflineException exception: |
|
Regarding |
|
@dgarske let me know your opinion. I can either revert the suggestions or move more fine grained. |
|
@anhu please review the errors. Looks like this needs a little more work. |
|
jenkins retest this please Found unhandled hudson.remoting.RequestAbortedException exception: |
|
I cannot gate on |
dgarske
left a comment
There was a problem hiding this comment.
Code is good now (in my opinion), but it will need squash before merge.
… RSA PSS with custom salt and mgf1 hash type. Adds compat API's for `i2d_PrivateKey_bio` , `BN_ucmp` and `X509v3_get_ext_by_NID`. ZD 20059
2325972 to
a36f908
Compare
There was a problem hiding this comment.
Pull Request Overview
Adds compatibility support for RSA-PSS with custom salt lengths and MGF1 hashing, plus utility APIs for private key BIO output, unsigned BIGNUM comparison, and X.509 extension lookup.
- Introduces
wolfSSL_i2d_PrivateKey_bioand maps it to the OpenSSL alias. - Extends
EVP_PKEY_CTXwith PSS salt length and MGF1-Hash setters; updates RSA sign/verify to use these parameters. - Adds
wolfSSL_BN_ucmpand X509v3 extension lookup functions (wolfSSL_X509v3_get_ext*), with corresponding OpenSSL-compatible macros.
Reviewed Changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| wolfssl/ssl.h | Declared wolfSSL_i2d_PrivateKey_bio |
| wolfssl/openssl/x509v3.h | Added wolfSSL_X509v3_get_ext and wolfSSL_X509v3_get_ext_by_NID |
| wolfssl/openssl/ssl.h | Mapped i2d_PrivateKey_bio to wolfSSL_i2d_PrivateKey_bio |
| wolfssl/openssl/rsa.h | Defined RSA-PSS salt-length constants and alias macros |
| wolfssl/openssl/evp.h | Added PSS saltlen and MGF1-hash setter prototypes |
| wolfssl/openssl/bn.h | Introduced wolfSSL_BN_ucmp and alias macro |
| wolfcrypt/src/rsa.c | Reformatted multi-line #if for direct RSA |
| wolfcrypt/src/evp.c | Initialized new fields in WOLFSSL_EVP_PKEY_CTX and implemented setters and integration for PSS parameters |
| tests/api.c | Added tests for RSA-PSS sign/verify and X509v3 extension stack lookup |
| src/x509.c | Implemented wolfSSL_X509v3_get_ext* functions |
| src/ssl_bn.c | Implemented unsigned BIGNUM comparison (BN_ucmp) |
| src/ssl.c | Implemented wolfSSL_i2d_PrivateKey_bio |
| src/pk.c | Refactored PSS salt-length calculation into helper function |
Comments suppressed due to low confidence (3)
src/ssl_bn.c:1162
- The new function wolfSSL_BN_ucmp lacks corresponding unit tests to verify its correctness across various cases (e.g., comparing positive, negative, and NULL BIGNUMs). Consider adding tests in tests/api.c to cover these scenarios.
int wolfSSL_BN_ucmp(const WOLFSSL_BIGNUM* a, const WOLFSSL_BIGNUM* b)
wolfssl/openssl/evp.h:952
- [nitpick] Consider adding documentation comments (e.g., Doxygen) for this new API to clarify its behavior, valid salt length values, and error conditions, improving maintainability and discoverability.
WOLFSSL_API int wolfSSL_EVP_PKEY_CTX_set_rsa_pss_saltlen(WOLFSSL_EVP_PKEY_CTX *ctx, int saltlen);
tests/api.c:5143
- [nitpick] The test function name uses a
wc_prefix but other OpenSSL-compat tests usetest_wolfSSL_prefixes (e.g.,test_wolfSSL_X509_*); consider renaming this for consistency.
static int test_wc_RsaPSS_DigitalSignVerify(void)
|
Jenkins retest this please: "Found unhandled org.jenkinsci.plugins.workflow.support.steps.AgentOfflineException exception:" |
|
Jenkins retest this please Oops! Not found. |
|
Jenkins retest this please. The FIPS-repo-and-harness-part1 test is failing, but history keeps being removed too soon. |
|
Jenkins retest this please. Ooops! Not found. |
|
Running config: --enable-fips=v2 --enable-opensslextra... |
|
Customer has approved these changes. |
|
Jenkins retest this please.
|
wolfSSL_RSA_signandwolfSSL_RSA_verifyto support RSA PSS with custom salt and mgf1 hash type.i2d_PrivateKey_bio,BN_ucmpandX509v3_get_ext_by_NID.ZD 20059