-
Notifications
You must be signed in to change notification settings - Fork 121
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
RSA key check consolidation part 2 #1502
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1502 +/- ##
==========================================
- Coverage 77.00% 76.98% -0.02%
==========================================
Files 425 425
Lines 71556 71546 -10
==========================================
- Hits 55103 55083 -20
- Misses 16453 16463 +10 ☔ View full report in Codecov by Sentry. |
if (boringssl_fips_break_test("RSA_PWCT")) { | ||
data[0] = ~data[0]; | ||
} |
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.
NP: This will be optimized away for release build, but we could guard this logic with #ifdef BORINGSSL_FIPS_BREAK_TESTS
,
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.
// In addition to invalid key type, stripped private keys can not be checked | ||
// with this function because they lack the public component which is | ||
// necessary for both FIPS checks performed here. | ||
if (key_type == RSA_KEY_TYPE_FOR_CHECKING_INVALID || |
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.
The RSA_is_opaque
no longer applies?
goto end; | ||
} | ||
|
||
if (!RSA_sign(NID_sha256, data, sizeof(data), sig, &sig_len, key)) { |
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.
We needed to use the EVP_DigestSign/Verify for the PCT test dbedeb7
data[0] = ~data[0]; | ||
} | ||
if (!RSA_verify(NID_sha256, data, sizeof(data), sig, sig_len, key)) { | ||
OPENSSL_PUT_ERROR(RSA, ERR_R_INTERNAL_ERROR); |
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 not keep RSA_R_PUBLIC_KEY_VALIDATION_FAILED
in the case of PCT failure as before?
if (boringssl_fips_break_test("RSA_PWCT")) { | ||
data[0] = ~data[0]; | ||
} |
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.
Issues:
CryptoAlg-2280
Description of changes:
This change tidies up and adds documentation for
RSA_check_fips
function. The only technical change is the implementation of the
pair-wise consistency check which was replaced with the one from
BoringSSL for simplicity.
Call-outs:
Point out areas that need special attention or support during the review process. Discuss architecture or design changes.
Testing:
How is this change tested (unit tests, fuzz tests, etc.)? Are there any testing steps to be verified by the reviewer?
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and the ISC license.