Repository navigation
FIPS 140-3 validated cryptography for signing, and checksums, and TLS #1464
yychen23
announced in
Announcement
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Previously, the SDK's SigV4, SigV4a signing, and request checksums were computed by the RustCrypto crates, which are not FIPS validated.
The AWS SDK for Rust can now route request signing, request checksums, and TLS through the FIPS 140-3 validated build of AWS-LC, with a single feature on your service crate.
A default build is unchanged. RustCrypto remains the default backend and is still the only one that builds on every target the SDK supports. Everything below is opt-in.
Available once smithy-lang/smithy-rs#4874 is merged and released, around end of Q4.
Toggle on
That's the whole switch. It fans out to the three paths for you, which otherwise reach a service crate by different routes: TLS through
aws-smithy-runtime, signing throughaws-runtimetoaws-sigv4, and checksums throughaws-smithy-checksums. A service without checksum operations simply doesn't gain that dependency.The individual crates also take features directly, if you depend on them outside a service client:
aws-lc-rs-fipstakes precedence overaws-lc-rs, and either takes precedence overrustcrypto.Enabling more than one, which Cargo feature unification does routinely, resolves to the strongest backend rather than failing to build.
One behavioral difference worth knowing if you assert on signatures in tests: SigV4 output is identical on every backend, but SigV4a output is not. ECDSA leaves the nonce to the implementation, and RustCrypto derives it per RFC 6979, so the same inputs always give the same signature, while AWS-LC's is not reproducible -- signing one string to sign twice yields two different signatures. Both are valid and a verifier accepts either.
Two intermediate features are also new and can be named directly if you want one path rather than all three:
aws-runtime/aws-lc-fipsfor signing, andaws-smithy-runtime/aws-lc-fipsfor TLS.MD5 is the one algorithm with no AWS-LC backend: aws-lc-rs does not expose it and it is not FIPS-approved. For flexible checksums that is not a behavior change, because
ChecksumAlgorithm::Md5is deprecated and already resolves to CRC-32.It is not the only MD5 path, though. An operation modeling
@httpChecksumRequiredgets acontent-md5header computed with themd-5crate, by a different mechanism thanChecksumAlgorithmand on every such request.s3-controlis the only AWS model carrying that trait, on 37 operations. These features do not change it and there is nothing to route it to.If your own manifest pins
aws-lc-rs, note these crates declare1.18, matching whatrustlsdeclares so the signing, checksum and TLS paths all ask for the same line.Removing the non-validated crates from the build
The feature above routes the cryptography through the validated module, but leaves the RustCrypto crates compiled, because the
rustcryptodefault is still on. If you need to show which implementations are present rather than merely which ones run, turn the defaults off and name back the ones you want:Measured on a generated
aws-sdk-dynamodb, that shape resolves nohmac,sha2,sha1,md-5, orring. Keeping the defaults and only addingaws-lc-fipsresolveshmac,sha2, andring, sodefault-features = falseis the part that does the work.This is why the change is breaking at all.
Note: With
sigv4a, additionallyp256,ecdsa,elliptic-curve,primefield,primeorder,crypto-bigint, andhmacandsha2underneath them. Those last two resolve to the same majors this crate declares for its own backend, so they are one copy each rather than a second older pair;crypto-bigintis the one that duplicates, the 0.5 declared for the signing key derivation plus the 0.7 thatelliptic-curvedepends on.crypto-bigintis called on every backend: it does the integer math of the key derivation, which is what the SigV4a specification defines rather than a cryptographic primitive. The ECDSA crates are not.p256cannot be dropped, because Cargo features are additive andsigv4ahas to keep declaring it, but in a FIPS build the RustCrypto backend module is cfg'd out and the only other references are behind#[cfg(test)], so nothing reaches it.Measured on an unstripped release build with
sigv4aandaws-lc-fipsboth on andrustcryptooff:p256,ecdsa,rfc6979,elliptic-curve,primefield,primeorder,hmacandsha2contribute zero symbols, against 2142 for the FIPS module and zero for non-FIPS AWS-LC. Read that as corroboration rather than proof --crypto-bigintalso contributes zero symbols despite being called, because its arithmetic inlines intogenerate_signing_key, so a zero count alone does not establish that a crate is unreachable.Separately, three generated crates declare a crypto crate directly, outside this mechanism and unaffected by these features. They are not equivalent to each other:
aws-sdk-s3declareshmacandsha2to key its in-memory S3 Express session cache. That is a salted hash standing in for credentials as a map key rather than a security function -- the salt is not even drawn from a CSPRNG -- so it reaches no request. Unlike thesigv4acrates above this one is called, and the same build measured there carriesS3ExpressIdentityCache::keyalong withsha2's SHA-256 compression function. So an audit of that binary findssha2in it, which is why getting it out is worth doing even though no request depends on it; tracked in smithy-rs#4909.aws-sdk-s3controldeclaresmd-5, for thecontent-md5header described above.aws-sdk-glacierdeclaresring, which computes itsx-amz-sha256-tree-hashheader and then substitutes that digest as the SigV4 payload hash.The last two are request cryptography on a library that is not the validated module, so a FIPS deployment of either service is not fully covered regardless of these features. See below.
Platform support
Both AWS-LC backends are a per-target capability, which is why
rustcryptostays the default.aws-lc-rsneeds only a C/C++ compiler and works on every target aws-lc-rs supports. Its only WASM target iswasm32-unknown-emscripten, sowasm32-unknown-unknownand the WASI targets must stay onrustcrypto.aws-lc-rs-fipsalways additionally needs CMake and Go, plus bindgen on any target without pre-generated FIPS bindings, which is everything except 64-bit Linux (gnu and musl) and macOS, so Windows MSVC and FreeBSD FIPS builds need it. It also covers a narrower target set: x86_64 and aarch64 Linux (gnu and musl),armmusleabi/musleabihf, powerpc/powerpc64/powerpc64le gnu, macOS, 64-bit Windows MSVC, and x86_64 FreeBSD.Notably not
i686-unknown-linux-gnu, riscv64, s390x, mips, NetBSD, iOS, Android, or WASM. Enabling a backend on a target its AWS-LC build doesn't support fails while buildingaws-lc-sysoraws-lc-fips-sys.What this does not cover
Worth reading before you treat a build as end-to-end FIPS.
TLS is only made FIPS for the hyper 1.x client from
aws-smithy-http-client. Two ways to missit:
BehaviorVersionolder thanv2026_01_12selects the legacy hyper 0.14.x client, whose TLS isrustls0.21 onring. Signing and checksums are still FIPS, but TLS is not. This combination now logs a warning naming the version to move to. UseBehaviorVersion::v2026_01_12()or later, or drop the legacy stack.s2n-tlsor a custom connector, is unaffected, since this feature does not install a client for you. That case cannot be detected and is not warned about. If you uses2n-tls, note it reaches the same validated module by a different route:s2n-tls/fipsforwards tos2n-tls-sys/fips, which isaws-lc-rs/fips. Enablings2n-tls's ownfipsfeature does give you FIPS TLS;aws-smithy-http-clientwill not forward it for you.aws-sdk-glacierandaws-sdk-s3controlcompute a request digest outside this mechanism, as above: Glacier's tree hash and the SigV4 payload hash it overrides come fromring, and s3control'scontent-md5frommd-5. Neither is the validated module, and in s3control's case MD5 is not FIPS-approved at all, so there is nothing to route it to.aws-config'scredentials-loginfeature signs DPoP (RFC 9449) proof JWTs withp256ECDSA itself, and that is not routed through AWS-LC. A FIPS deployment usingcredentials-loginis not fully covered.aws-config'sssoandcredentials-loginfeatures hash a start URL or session string with SHA-1 and SHA-256 to name a cache file. Those stay on RustCrypto; they are not security functions.Breaking changes
default-features = falsenow drops the crypto backend on four crates. Every affected build fails to compile with a message naming the fix, rather than silently losing cryptography:aws-sigv4rustcryptoto a--no-default-featuresbuildaws-smithy-checksumsaws-runtimeaws-configGenerated SDK crates gain a default-on
rustcryptofeature for the same reason. Theirdefaultlist already existed, so a build on defaults is unaffected; a build withdefault-features = falseneedsrustcryptoadded unless it is namingaws-lc-fipson purpose.All of these ship below a major deliberately. A major on any one would split the released SDK's dependency graph:
aws_runtime::invocation_id'sSharedInvocationIdGeneratorandInvocationIdGeneratorare public surface of every generated SDK crate, andaws-configre-exports fiveenv_configtypes, so an application namingaws-runtime = "1"and exchanging one of those with its SDK client would stop compiling on a version-identity mismatch, and staying consistent would mean major-bumping everyaws-sdk-*crate.aws-sigv4is held to the same line one step removed, sinceaws_runtime::auth::SigningOptionscarries apayload_override: Option<SignableBody<'static>>. A flag that previously did nothing is the narrower thing to break.The choice has to be forwarded at every level because Cargo gives a consumer no way to switch off a transitive crate's default features. Only the crate that declares the dependency can do that. So "no RustCrypto in this build" has to be expressible at each link, and the chain from an application to the signer is three deep: service crate,
aws-runtime,aws-sigv4.All reactions