-
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
Ensure service indicator is incremented only once, update RSA and ED25519 to ensure the state is locked #2112
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2112 +/- ##
=======================================
Coverage 78.97% 78.97%
=======================================
Files 611 611
Lines 105500 105504 +4
Branches 14938 14937 -1
=======================================
+ Hits 83316 83322 +6
+ Misses 21531 21529 -2
Partials 653 653 ☔ View full report in Codecov by Sentry. |
You'll want to rebase since Ed25519ph got merged in, but I think we are aligned / should be fixed now in the functions you touched. |
…5519 to ensure the state is locked
626dbf3
to
354fc6f
Compare
int res = ED25519ph_sign_digest_no_self_test(out_sig, digest, private_key, | ||
context, context_len); | ||
FIPS_service_indicator_unlock_state(); |
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.
Here I thought I got it right in all of the places :)
Issues:
Resolves P186477736
Description of changes:
Currently the service indicator checks that
before != after
and multiple approved APIs might call each other. If a lock is missed a lower approved algorithm will increment the count which incorrectly marks the higher level API as approved. This is happening in three spots:This change updates the service indicator to enforce
before + 1 == after
with a debug assert.Call-outs
This doesn't change the external behavior of the service indicator, what algorithms are approved, or what APIs are approved. The service indicator tests are unchanged. This change just ensures what we expect to be modifying the indicator is in the thing doing the update.
Testing:
The existing service indicator tests cover all approved APIs, and the new requirement that
before + 1 = after
ensures only one thing per call increments the count.I took out a lock and verified it failed as expected:
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.