Skip to content

jplock impl (fips for aws-sigv4) + resolve merge conflicts - #2

Draft
jkaczman wants to merge 3 commits into
mainfrom
jk-sigv4-fips
Draft

jkaczman wants to merge 3 commits into
mainfrom
jk-sigv4-fips

Conversation

@jkaczman

@jkaczman jkaczman commented Sep 22, 2026

Copy link
Copy Markdown
Collaborator

Re:

This is an unmerged PR into smithy-rs that someone created (but didn't try to merge, as the maintainers didn't want to support the extra feature). Going to see if I can work off of this.

jplock and others added 3 commits June 12, 2026 22:20
Route SigV4 HMAC-SHA256 / SHA-256 and (when combined with sigv4a)
SigV4a ECDSA-P256 through aws-lc-rs (or aws-lc-fips-sys) when the new
features are enabled, mirroring the additive __rustls / rustls-aws-lc /
rustls-aws-lc-fips pattern in aws-smithy-http-client and the companion
PR smithy-lang#4690 for aws-smithy-checksums. The default build is unchanged and
keeps the existing hmac / sha2 / p256 (RustCrypto) path; the new
features are strictly opt-in.

This is the aws-sigv4 half of smithy-rs#4681. With both halves landed,
FIPS-conscious customers can route TLS, request checksums, and request
signing end-to-end through aws-lc-rs without forking the runtime
crates.

An internal __aws-lc-rs feature gates every swapped code path; the
public aws-lc-rs and fips features each select the aws-lc-rs backend
explicitly (aws-lc-sys vs aws-lc-fips-sys). Source-level cfgs ensure
that when __aws-lc-rs is active, no RustCrypto cryptographic code path
is executed for SigV4 or SigV4a, even when sigv4a is also enabled.

For the SigV4a ECDSA path, the existing 32-byte deterministic scalar
contract from generate_signing_key is preserved. calculate_signature
wraps the scalar in a minimal 51-byte RFC 5915 SEC1 ECPrivateKey DER
(publicKey field intentionally omitted) and hands it to
EcdsaKeyPair::from_private_key_der, which lets AWS-LC derive the
public point internally — no p256 code path is required.

Verified on macOS (aarch64-apple-darwin):
- cargo test -p aws-sigv4              (default, RustCrypto)  89 ok
- cargo test -p aws-sigv4 --features sigv4a                  124 ok
- cargo test -p aws-sigv4 --features aws-lc-rs                89 ok
- cargo test -p aws-sigv4 --features "aws-lc-rs sigv4a"      124 ok
- cargo build -p aws-sigv4 --features "fips sigv4a"          ok
- cargo clippy -p aws-sigv4 --features "aws-lc-rs sigv4a" --all-targets -- -D warnings  clean
This is an unmerged PR into smithy-rs that someone created ([but didn't try to merge, as the maintainers didn't want to support the extra feature](smithy-lang#4690)). Going to see if I can work off of this.
@jkaczman jkaczman changed the title jplock impl + resolve merge conflicts jplock impl (fips for aws-sigv4) + resolve merge conflicts Sep 22, 2026
@jkaczman
jkaczman marked this pull request as draft September 22, 2026 12:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants