Skip to content

feat(crypto): add selectable RustCrypto algorithm features - #1074

Closed
Xuanwo wants to merge 1 commit into
mainfrom
xuanwo/remove-unused-rsa-pkcs5
Closed

Xuanwo wants to merge 1 commit into
mainfrom
xuanwo/remove-unused-rsa-pkcs5

Conversation

@Xuanwo

@Xuanwo Xuanwo commented Nov 25, 2026

Copy link
Copy Markdown
Member

Summary

  • Add selectable rsa, p256, and aes-gcm features to reqsign-crypto-rustcrypto, all enabled by default. MD5, SHA-1, SHA-256, HMAC-SHA-1/256/512, and HMAC-SHA512 stay unconditional.
  • Disabled operations return ConfigInvalid naming the missing feature, including secure randomness. RSA, AES-GCM, and randomness remain unsupported on wasm32-unknown-unknown when enabled; P-256 stays available.
  • The facade exposes no algorithm features. default-crypto depends on the backend with default-features = false; service features weakly select only what they need: aws-v4a -> p256; azure, google, oracle, and http-message-signatures -> rsa. A service feature alone does not pull the backend.
  • Remove the facade google-credential-access-boundary-client-side feature. Client-side CAB is now opt-in through reqsign-google/credential-access-boundary-client-side with a provider supporting AES-GCM and secure randomness, plus an HttpSend transport for STS. If a graph also enables facade google, Cargo feature unification can expose the type through facade re-exports; that is not a facade feature.
  • The 0.21 release notes cover both this feature selection and the merged Arc<T> forwarding for CryptoProvider (Implement CryptoProvider for Arc<T> in reqsign-core #1068).

Google client-side CAB migration

  • First acquisition or refresh of intermediary credentials goes to STS. A valid cached intermediary enables local issuance of downscoped tokens.
  • The rustdoc example is runnable and uses a mock STS transport with the public Granter::grant(None) path. Only the aes-gcm backend feature is required; the example uses a public test vector, not credentials.
  • The upgrade guide, service README, and facade docs describe the facade feature removal, direct service opt-in, the Cargo-unification re-export caveat, and the AES-GCM/secure-randomness plus HttpSend requirements.

CI coverage

  • Backend feature matrix: default, no-default, each algorithm alone, and all three together, including missing-feature diagnostics.
  • All 25 facade service features plus the full aggregate are built and behavior-tested in isolated downstream Cargo invocations. Probes exercise actual RSA, P-256, AES-GCM, randomness, hash, and HMAC operations, and verify a service feature alone does not pull the backend.
  • A shared service table drives both the weak-mapping static check and the actual-operation oracle. full is validated by resolved feature expansion; deleting vercel from full fails with full does not enable service features: ['vercel'].
  • Existing crypto dependency-boundary and website provider-catalog checks remain.

Verification

  • cargo fmt --all -- --check
  • cargo clippy --workspace --all-targets --all-features -- -D warnings
  • cargo test --workspace --no-fail-fast
  • cargo test --doc --all-features --workspace
  • cargo test -p reqsign-google --features credential-access-boundary-client-side --lib --tests
  • python3 .github/scripts/check_crypto_features.py
  • python3 .github/scripts/test_facade_features.py
  • node website/scripts/validate-providers.mjs
  • Release plan: 32 packages. Workspace publish dry run: 31 staged uploads / 31 dry-run aborts. Standalone reqsign-crypto-boring packaging: 12 files, 4 staged local dependencies normalized without paths.
  • Integrated tree equals the feat(core): implement CryptoProvider for Arc<T> #1073 merge-tree before the additive release-note and review-fix commits; the original candidate patch-id is preserved.

Part of #1069.

Downstream follow-up

SMB lock resolution is downstream and is not claimed here. After the actual 0.21 release, the maintainers will open and then notify the dedicated OpenDAL issue for the SMB lockfile path. This PR does not edit OpenDAL or notify it.

The RustCrypto backend only accepts unencrypted PKCS#8 and PKCS#1 RSA private keys, so rsa's pkcs5 feature is unused. Removing it drops pkcs5, scrypt, salsa20, cbc, pbkdf2, and block-padding from the dependency graph.

Part of #1069.
@Xuanwo Xuanwo closed this Nov 25, 2026
@Xuanwo
Xuanwo deleted the xuanwo/remove-unused-rsa-pkcs5 branch November 25, 2026 18:46
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.

1 participant