Repository navigation
Replies: 1 comment
|
Mailing list thread: https://lists.apache.org/thread/vf75p8xhdg5tk55b6hgfz286o7h5l3s5 |
0 replies
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.
Summary
Reqsign will move its cryptographic implementations into separate provider crates. A process-wide
reqsign_core::crypto::CryptoProvidersupplies SHA-1, SHA-256, HMAC-SHA1, HMAC-SHA256, RSA signing, P-256 ECDSA signing, AES-GCM encryption, and secure random bytes. This is a breaking change.reqsign-coreand the service crates lose their production dependencies on cryptographic implementations. Applications install a provider before signing requests or loading credentials that require cryptography.Registration and errors
crypto::install_default(provider)stores anArc<dyn CryptoProvider>in aOnceLock. Exactly one installation succeeds, including when calls race. Later calls return the proposed provider inErrand keep the installed provider.crypto::get_default()returns anOption<&'static Arc<dyn CryptoProvider>>. ReadingNoneleaves installation available.The top-level application owns configuration. Integrating libraries such as OpenDAL leave registration to the application. The
reqsignfacade enables adefault-cryptofeature by default and re-exportsRustCryptoProvider. Applications still callRustCryptoProvider::install_default()or install their chosen provider once at startup.default_context()remains independent of crypto registration.All crypto operations return
Result. A missing provider or unsupported operation returns non-retryableConfigInvalid. Invalid key material returnsCredentialInvalid. Internal backend failures returnUnexpected. The core hash and HMAC helpers preserve their output formats and returnResult. Encoding-only helpers keep their existing signatures.jwt::encode_rs256_pemremains the public PEM-bytes entry point. The overload that acceptsrsa::RsaPrivateKeyis removed.Provider contract
The trait requires implementations for SHA-1 and SHA-256 and their HMAC variants, with fixed-width digest output. The other four operations have a default implementation that reports
ConfigInvalid.Protocol logic remains in its service crate. This includes the AWS SigV4a key derivation and scalar range check, Azure certificate thumbprint and assertion handling, Google service-account and client-side Credential Access Boundary flows, and Oracle request signing. Each path invokes the provider for its cryptographic primitives and retains its wire format.
Official providers
reqsign-crypto-rustcryptolives incrypto/rustcryptoand is part of the main workspace. It implements all eight operations on native targets. On the supported WASM target it implements SHA-1, SHA-256, HMAC-SHA1, HMAC-SHA256, and P-256 ECDSA. RSA, AES-GCM, and secure random reportConfigInvalidthere.reqsign-crypto-boringlives incrypto/boringand has its own version line. It implements all eight operations on native targets through safe, stateless BoringSSL calls and offers an optionalfipsfeature. The main workspace excludes it and retains a pure Rust build. A dedicated Linux job checks the adapter.Validation
Coverage will include registration and missing-provider errors in separate test processes, fixed SHA and HMAC vectors and boundary inputs, identical RSA and AES-GCM output across providers, and P-256 signatures that verify across backends. A signer test will exercise BoringSSL through the public Reqsign API. Dependency checks will confirm the core and service production graphs are free of the cryptographic implementation crates. Workspace and standalone CI will verify the supported platforms.
Implementation
The implementation PR #970 is ready for review. Its
docs/crypto-provider.mddescribes the full contract and migration steps.Original contribution #923
All reactions