Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Cryptography inventory and FIPS 140-3 status

This page lists every cryptographic primitive the workspace uses, where it lives, which library provides it, and whether it can run on the FIPS 140-3 validated AWS-LC module. It is the reference for FIPS and crypto audits.

Each source file that implements or selects a primitive carries a one-line comment // Crypto inventory: <ID> that points at a row below. Callers that only use a seam (for example HTTPS clients built on rustls) are covered by the marker of the seam (tls-provider, NET-1) and carry none of their own. When you add, move or remove cryptography, update the row and the comment in the same change (see the checklist at the end).

Reading the status column

StatusMeaning
ValidatedRuns on the validated AWS-LC module when built with the fips feature of its crate (or of the service).
Not validatedUses a library without a FIPS 140-3 validation. Replacing it needs a design change or a different library.
Compat-fixedThe algorithm is dictated by an external format (Python Keystone, AWS, RFC 6238, WebAuthn). It cannot be swapped without breaking interoperability.
Not a security primitiveHashing or randomness for identifiers, never a secret or a trust decision.
DelegatedThe work happens outside this process (HSM, TPM, PostgreSQL). Its validation is the device’s.

“Validated” is a statement about which implementation is linked, based on the aws-lc-rs documentation and tests for the fips feature. It is not a CMVP certificate claim, and an operator still has to check the security policy of the module version that ships (see Caveats).

Build modes

CrateDefault buildfips feature
openstack-keystone-storage-cryptoring (AES-GCM, HKDF, HMAC, RNG)aws-lc-rs with its fips feature: AES-256-GCM, HKDF, HMAC, RNG. GCM IVs are generated inside the module, with a per-message key. See ADR 0016-v2 “FIPS builds”.
cadfring (HMAC-SHA256, HKDF, RNG)aws-lc-rs with its fips feature: HMAC, HKDF, RNG.
openstack-keystone-tls-providerringaws-lc selects aws-lc-rs; fips adds rustls’ fips feature (validated module). Used by rustls, tokio-rustls, tonic, reqwest, vaultrs, ldap3.
openstack-keystone-distributed-storageforwards to storage-cryptofips forwards to storage-crypto.
openstack-keystone (service)ring everywhererustls-aws-lc switches TLS to aws-lc-rs; fips also selects the validated module for TLS and for the storage cryptography.

Use --no-default-features --features fips on storage-crypto and cadf to keep ring out of those crates. A process that makes a FIPS claim must call assert_fips() (storage-crypto and cadf both export it) and openstack_keystone_tls_provider::is_fips() at start-up. They fail unless the validated module is linked and in FIPS mode.

Mixing builds in one Raft cluster is unsupported. By design a fips node can read records written by a default node (legacy base-key fallback in storage-crypto), but a default node cannot read records written by a fips node. Only the first direction has a unit test (the legacy state-record version binding); the cross-build read is not tested end to end.

Inventory

Distributed storage (storage-crypto, storage, KEK providers)

IDWherePrimitiveProviderStatus
STO-1storage-crypto/src/cipher.rs, backend.rsAES-256-GCM for Raft log, state machine and backup recordsring; aws-lc-rs RandomizedNonceKey in fipsValidated in fips (module-generated IV, per-message key). Default build uses deterministic nonces (SP 800-38D §8.2.1).
STO-2storage-crypto/src/dek.rs, backend.rsHKDF-SHA256 (Extract-then-Expand) for the Log, State, Backup and audit sub-keysring; aws-lc-rsValidated in fips.
STO-3storage-crypto/src/cipher.rsHKDF-SHA256 per-message key (fips only) and Expand-only nonce derivation (default only)sameValidated in fips. The default-build Expand-only nonce derivation is not an approved flow; it is skipped in fips.
STO-4storage-crypto/src/kek.rsEnvKek: AES-256-GCM wrap of the DEK. Wrap nonce is a truncated HMAC-SHA256 (default); module IV (fips)sameValidated in fips.
STO-5storage-crypto/src/dek.rsDEK generation from the system RNGring SystemRandom; aws-lc-rs DRBGValidated in fips.
STO-6storage-crypto-pkcs11/src/lib.rsCKM_AES_GCM wrap of the DEK inside the token; optional token-generated IVcryptokiDelegated to the PKCS#11 token. The token-generated-IV path uses the message API and is untested on hardware.
STO-7storage-crypto-tpm/src/lib.rsTPM 2.0 AES-CFB wrap of the DEK, HMAC tag computed by the TPM, 16-byte IV from randtss-esapiDelegated to the TPM. Single-node only. The IV comes from rand, not the TPM RNG, and AES-CFB is not the SP 800-38D mode used elsewhere.
STO-8storage/src/store/state_machine/snapshot.rsRandom 64-bit nonce salt of a backupstorage-crypto random_bytesValidated in fips.
STO-9storage/src/network.rs, keystone/src/server/listener/raft_grpc.rsmTLS between Raft nodes, tonic, x509-parser for peer certificatesrustls through openstack-keystone-tls-providerValidated with the service fips feature, except SPIFFE mTLS (STO-12).
STO-12spiffe-rustls, spiffe-rustls-tokioSPIFFE X.509-SVID mTLSring, hardwired by spiffe-rustlsNot validated. Always ring; see TLS.
STO-10storage/src/network.rs, raft_grpc.rs (tests, dev certs)rcgen certificate generationrcgen ringNot validated. Test and development only.
STO-11storage/src/store/state_machine/*.rs, raft_sm.rsrand for snapshot indexesrandNot a security primitive.

Audit framework (cadf)

IDWherePrimitiveProviderStatus
AUD-1cadf/src/crypto.rs, dispatcher.rsHMAC-SHA256 signature over the JCS-canonical event, constant-time verificationring; aws-lc-rsValidated in fips.
AUD-2cadf/src/kdf.rs, identity.rsPer-node signing key: HKDF(salt = "{service}-audit-hmac-salt-v1", IKM = KEK, info = "{service}-audit-hmac-v1:{node_id}")ring; aws-lc-rsValidated in fips.
AUD-3cadf/src/keyring.rs32-byte KEK generation for the audit keyringring SystemRandom; aws-lc-rs DRBGValidated in fips.
AUD-4cadf/src/syslog.rsRFC 5425 syslog over TLS (audit-syslog feature), webpki roots from rustls-native-certsrustls through openstack-keystone-tls-providerValidated with the service fips feature.
AUD-5cadf/src/runtime.rs, spool.rsuuid v4 event identifiersuuid (OS RNG)Not a security primitive.

Tokens, keys and credentials

IDWherePrimitiveProviderStatus
TOK-1key-repository, token-driver-fernet, credential-driver-sqlFernet (AES-128-CBC + HMAC-SHA256) for tokens and for credential blobs; keys from Fernet::generate_keyfernet 0.2 (RustCrypto aes, cbc, hmac)Compat-fixed (Python Keystone format) and Not validated.
TOK-2key-repository/src/asymmetric/keygen.rs, jwt_bridge.rs, token-driver-jwsES256 (P-256) and RS256 (RSA-2048) key generation and JWS signingp256, rsa, jsonwebtoken rust_cryptoNot validated. RSA-2048 is allowed through 2030 by SP 800-131A; ES256 is approved by algorithm.
TOK-3core/src/oauth2_key/*, spiffe_key/*JWKS publication, key ids, domain signing keys (ES256/RS256)sameNot validated.
TOK-4keystone/src/federation/api/oidc_utils.rs, core/src/oauth2_client/verify.rsVerification of upstream OIDC ID tokens and client assertions (asymmetric algorithms only)jsonwebtokenNot validated. The algorithm set is the peer’s.
TOK-5core/src/oauth2_client/pkce.rs, oauth2_session*.rs, auth_plugin_auth.rs, mapping/version.rs, identity/shadow_id.rsSHA-256 (PKCE S256, token and code hashes, ids)sha2SHA-256 is approved; the implementation is Not validated.
TOK-6core/src/auth_plugin.rs, mapping/hmac.rsHMAC-SHA256 for auth-plugin handles and mapping fingerprintshmac+sha2Not validated (approved algorithm).
TOK-7core/src/api_key/crypto.rs, oauth2_client/crypto.rsArgon2id for API key and OAuth2 client secrets; random secrets from randargon2, randNot validated. Argon2id is not an approved KDF under SP 800-132.
TOK-8core/src/api_key/token.rsSHA-256 and CRC32 of the API key checksum, random base62 entropysha2, crc32fast, randCRC32 is Not a security primitive; entropy source Not validated.
TOK-9keystone/src/api/v4/oauth2/html.rs, federation/api/oidc_utils.rsCSP nonce, OIDC state/nonce values from randrandNot validated (OS RNG).
TOK-10auth-plugin-runtime/src/lib.rsSHA-256 integrity check of plugin artifactssha2Not validated (approved algorithm).

Users and external protocol compatibility

IDWherePrimitiveProviderStatus
PWD-1password-hashing/src/bcrypt.rs, bcrypt_sha256.rsbcrypt and bcrypt-sha256 password hashesbcrypt, hmac, sha2Compat-fixed (existing Python Keystone hashes) and Not validated; bcrypt is not an approved password KDF.
PWD-2password-hashing/src/scrypt.rsscryptscryptCompat-fixed, Not validated.
PWD-3password-hashing/src/pbkdf2.rsPBKDF2-HMAC-SHA512hmac, sha2Compat-fixed. The algorithm is approved (SP 800-132); the implementation is Not validated.
PWD-4password-hashing/src/plaintext.rs, lib.rsConstant-time compare, random 16-byte saltsubtle, randNot validated (OS RNG).
EC2-1core/src/credential/ec2_signature.rsAWS Signature v2 (HMAC-SHA1, HMAC-SHA256) and v4 (HMAC-SHA256) verificationhmac, sha1, sha2Compat-fixed (AWS protocol). HMAC-SHA1 is allowed for MAC use, not for signatures. Not validated.
TOTP-1core/src/credential/totp.rsHMAC-SHA1 TOTP (RFC 6238)hmac, sha1Compat-fixed, Not validated.
WEB-1webauthn crate, api-types/src/webauthn/*WebAuthn registration and assertion verification (ES256, RS256, attestation chains)webauthn-rs (links system OpenSSL through openssl)Not validated by this build; validity follows the system OpenSSL.

Transport and databases

IDWherePrimitiveProviderStatus
NET-1keystone (reqwest), cli-manage, assignment-driver-openfga, oslo-config (Vault)HTTPS clientsrustls through openstack-keystone-tls-providerValidated with the service fips feature.
NET-2identity-driver-ldapLDAPS / StartTLSldap3; the rustls-aws-lc feature selects aws-lc-rsValidated with the service fips feature. The rand use there only shuffles server URLs.
NET-3sea-orm / sqlx in all *-sql drivers and cli-manageTLS to MySQL and PostgreSQLruntime-tokio-native-tls (system OpenSSL)Delegated to the system OpenSSL. FIPS validity follows the host’s OpenSSL provider.

Tests and tools (no production impact)

tests/* and tools/* use sha2, hmac, sha1, jsonwebtoken and rcgen to build fixtures and cross-check against Python Keystone (tools/cross_verify.py, tools/generate_kats.py, tools/audit_vectors.py). tools/verify_and_pin_opa_bundle.sh and the Dockerfiles use sha256sum to pin downloaded artifacts. None of it ships in a service binary.

TLS and transport gaps

TLS follows openstack-keystone-tls-provider. With the service fips feature, rustls runs on the validated module through its own fips feature. This is the design of the provider crate; this inventory did not re-verify it with a handshake test.

Remaining gaps:

  • SPIFFE mTLS (spiffe-rustls) hardwires ring and stays on it in every build, so Raft peers authenticated by SPIFFE identities are not on the validated module.
  • Database TLS (sea-orm/sqlx with native-tls) and WebAuthn use the system OpenSSL.
  • An aws-lc or fips TLS build links aws-lc-sys or aws-lc-fips-sys next to the fips build of storage-crypto and cadf; the libraries use distinct symbol prefixes and coexist in one binary.

Caveats

  • The validated module only treats AES-GCM encryption as an approved service when it generates the IV. The fips build therefore never supplies an IV for encryption; decryption with an external IV is approved.
  • HKDF is only used as Extract-then-Expand with a non-empty salt and info in the fips build, which is the flow the aws-lc-rs documentation lists as an approved service. Expand-only HKDF remains in default-build nonce derivation and is never executed in fips.
  • Both assert_fips() functions check that the validated module is the one linked and running in FIPS mode. They do not prove that every call a binary makes into any library is an approved service; TOK-, PWD-, EC2-, TOTP-, WEB-* and NET-* are outside the module.
  • Hashes and MACs called “approved algorithm” above are NIST-approved algorithms, not validated implementations.
  • The statements here come from the aws-lc-rs documentation and source and from tests of this repository, not from the CMVP security policy of the module. Check the policy for the exact module version before an audit.

Maintenance checklist

When a change adds or alters cryptography:

  1. Add or update the row in this file with provider and status.
  2. Add // Crypto inventory: <ID> below the license header of each file that calls the primitive.
  3. If the primitive can run on the validated module, route it through the crate’s backend seam rather than calling the library directly, and add a known-answer test that runs in both builds.
  4. Run the unit tests with and without the fips feature for storage-crypto and cadf.
  5. Re-run grep -rnE "\b(use|extern crate) (sha2|sha1|hmac|hkdf|argon2|bcrypt|scrypt|fernet|jsonwebtoken|rsa|p256|rand|getrandom|ring|aws_lc_rs|rustls|webauthn_rs|cryptoki|tss_esapi)\b" crates --include=*.rs and check that every file it lists is covered by a row. Fully qualified uses without a use line (sha2::Sha256::new()) need a second grep for \b(sha2|sha1|hmac|hkdf)::.