Conversation
Contributor
|
🔒 Security Review — View Report Please review before merging. |
Wire Duvet coverage for the Ed25519 / Ed25519ph surface in crypto/fipsmodule/curve25519/. Requirements are extracted from RFC 8032 prose, with a few descriptive (non-RFC-2119) statements hand-authored in rfc8032-requirements/. Source is annotated with //= citations and matching type=test annotations. Adds .duvet/README.md covering layout and local report generation. Reports are gitignored, not published.
Add check_annotations.py, which snapshots the source-code //= citations Duvet parses and fails when any baselined annotation is removed or broken. Adding annotations never fails; refresh the baseline with --update. The Duvet Annotation Coverage workflow runs the check on PRs touching .duvet/ or the annotated source and uploads the HTML report as an artifact.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3477 +/- ##
==========================================
+ Coverage 78.02% 78.20% +0.17%
==========================================
Files 700 700
Lines 125037 125886 +849
Branches 17343 17411 +68
==========================================
+ Hits 97563 98452 +889
+ Misses 26605 26563 -42
- Partials 869 871 +2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
sgmenda
previously approved these changes
Sep 14, 2026
Duvet releases to Crates are lagging- but this could be a forcing function, so agree. Co-authored-by: Sanketh Menda <sgmenda@amazon.com>
Co-authored-by: Sanketh Menda <sgmenda@amazon.com>
Declares FIPS_service_indicator_lock/unlock_state directly instead of relying on bcm.c amalgamation include order. Silences clang-tidy implicit-function-declaration on standalone/diff analysis.
The regression check diffed a multiset keyed only on (target#section, kind, source_file). Two distinct citations to the same triple (e.g. curve25519.c cites rfc8032#section-5.1 on both ED25519_sign and ED25519ph_sign) collided: deleting one while adding another to the same triple netted to zero and CI reported OK, masking the removal. Include the duvet-reported source line in the key so same-triple citations are distinct. duvet does not carry the quoted //# text on source citations, so line is the only available disambiguator; baseline regenerated to the 4-column format.
Bare --version 0.4 fails cargo arg-parsing (needs full X.Y.Z or an explicit comparator like ^0.4).
Contributor
Author
|
This reverts commit 64a06fb.
dougch
added a commit
that referenced
this pull request
Sep 16, 2026
### 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-declaration` warning. This PR fixes the underlying cause independently of that annotation work. ### Description of changes: `crypto/fipsmodule/curve25519/curve25519.c` calls `FIPS_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: - No functional change today: in FIPS builds the module links as a unit and the real symbol resolves; the assumed `int f()` prototype vs. actual `void f(void)` is harmless for a no-arg call. - The fix matters as latent correctness: implicit declarations are a hard error under C23 / newer clang, and in non-FIPS builds the missing include bypasses the intended `OPENSSL_INLINE` no-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.
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.
Context and motivation
Requirement-to-code traceability makes it visible which spec requirements are actually implemented and tested, and keeps that link from silently rotting. This PR is a focused demonstration on the EdDSA surface; it does not publish a report or gate on full coverage.
Description of changes
Adds a scoped Duvet setup that traces RFC 8032 (EdDSA) requirements to the Ed25519 / Ed25519ph implementation and tests in
crypto/fipsmodule/curve25519/, plus a CI check that fails when a requirement annotation is removed.Duvet links each normative spec requirement to the source that implements and tests it, via in-tree
//=citation annotations, and reports coverage.Contents
.duvet/config.toml— source patterns, the RFC 8032 spec, requirement patterns, report config..duvet/requirements/— requirements extracted from RFC 8032 prose (duvet extract)..duvet/rfc8032-requirements/— a few descriptive (non-RFC-2119) statements pinned by hand.//=citations incurve25519.cand matchingtype=testcitations ined25519_test.cc..duvet/README.md— layout, links, and how to generate reports locally..duvet/scripts/check_annotations.py+.duvet/annotations.baseline— annotation-regression guard..github/workflows/duvet.yml— runs the guard on PRs touching.duvet/or the annotated source, and uploads the HTML report as an artifact.Testing
The
Duvet Annotation Coverageworkflow installs Duvet (cargo install duvet --locked, matching the existingcheck-test-vectorsworkflow) and runs the regression guard://=citation is removed or broken.Refresh the baseline after intentional changes:
Generated reports live under
.duvet/reports/and are gitignored — nothing is published.Sample local report
Screenshot showing the RFC passage and the associated line in the code where this is implemented. Note the missing test, which doesn't mean we're not testing, but that the annotation hasn't been created.

Review considerations
duvet report --ci(which demands 100% coverage) so the check targets removals without forcing every extracted requirement to be cited.section-8.7implementation citation is not yet paired with a test; tracked in the README TODOs.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.