fix: declare FIPS service-indicator funcs in curve25519.c - #3514
Open
dougch wants to merge 1 commit into
Open
Conversation
curve25519.c calls FIPS_service_indicator_lock_state/unlock_state but never includes their declaring header, relying on an implicit function declaration. Add "../service_indicator/internal.h" to match the 12 other fipsmodule files that use these functions. Implicit declarations are a hard error under C23/newer clang, and in non-FIPS builds this bypasses the intended OPENSSL_INLINE no-op.
Contributor
|
🔒 Security Review — View Report Please review before merging. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3514 +/- ##
==========================================
+ Coverage 78.36% 78.40% +0.03%
==========================================
Files 700 700
Lines 125684 125684
Branches 17377 17377
==========================================
+ Hits 98490 98539 +49
+ Misses 26322 26272 -50
- Partials 872 873 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
torben-hansen
approved these changes
Sep 10, 2026
prasden
approved these changes
Sep 11, 2026
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.
Issues:
No GitHub issue. Root cause surfaced by the clang-tidy run on #3477 (RFC 8032 Duvet annotations), which added comment lines adjacent to these calls and re-triggered a pre-existing
implicit-function-declarationwarning. This PR fixes the underlying cause independently of that annotation work.Description of changes:
crypto/fipsmodule/curve25519/curve25519.ccallsFIPS_service_indicator_lock_state()/FIPS_service_indicator_unlock_state()but does not include the header that declares them,crypto/fipsmodule/service_indicator/internal.h. Nothing in its existing include chain reaches that header (the public<openssl/service_indicator.h>does not declare the lock/unlock functions), so the calls rely on an implicit function declaration.This change adds
#include "../service_indicator/internal.h", matching the 12 other fipsmodule translation units that use these functions (e.g.hmac.c,ec_key.c,ecdh.c,e_aesccm.c).Call-outs:
int f()prototype vs. actualvoid f(void)is harmless for a no-arg call.OPENSSL_INLINEno-op definition.Testing:
No new tests. Covered by existing curve25519/Ed25519 suites; the change only makes an already-used declaration visible. Verified the include path matches sibling fipsmodule files.
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.