-
Notifications
You must be signed in to change notification settings - Fork 759
🔒 Upgrade Cryptography Libraries to Latest RC Versions #837
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Upgrade aes-gcm to 0.11.0-rc.2 with rand_core support - Upgrade chacha20poly1305 to 0.11.0-rc.2 - Upgrade argon2 to 0.6.0-rc.2 with std features - Upgrade hmac to 0.13.0-rc.3 - Upgrade pbkdf2 to 0.13.0-rc.2 - Upgrade rsa to 0.10.0-rc.10 - Upgrade sha1 and sha2 to 0.11.0-rc.3 - Upgrade md-5 to 0.11.0-rc.3 These upgrades provide enhanced security features and performance improvements while maintaining backward compatibility with existing encryption workflows.
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.OpenSSF ScorecardScorecard details
Scanned Files
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR upgrades cryptography dependencies from stable versions to latest release candidate (RC) versions, bringing the project closer to the next major releases of these libraries. The upgrade addresses breaking API changes in the cryptography crates, particularly around nonce/key creation methods that now prefer try_from over from_slice, and changes to how hasher methods are called.
Key Changes:
- Updated API usage patterns for AEAD ciphers (AES-GCM, ChaCha20-Poly1305) to use
try_frominstead offrom_sliceand pass references instead of values - Replaced
write/flushmethods withupdatefor hash digest APIs - Switched from
OsRngtorand::rng()for random number generation - Added
faster-hexdependency to replaceformat!("{:x}")for hex encoding
Reviewed Changes
Copilot reviewed 19 out of 20 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| Cargo.toml | Updated cryptography crate versions to RC releases and added faster-hex dependency |
| crates/utils/src/crypto.rs | Added KeyInit import for HMAC API changes |
| crates/rio/src/hash_reader.rs | Replaced format macro with faster-hex for MD5 hash encoding |
| crates/rio/src/etag_reader.rs | Replaced format macro with faster-hex for MD5 hash encoding |
| crates/rio/src/encrypt_reader.rs | Updated nonce creation to use try_from and pass references for encrypt/decrypt |
| crates/kms/src/encryption/ciphers.rs | Updated cipher APIs to use try_from for keys/nonces and switched to rand::rng() |
| crates/kms/src/backends/local.rs | Updated nonce handling to use arrays and try_from with proper error handling |
| crates/ecstore/src/set_disk.rs | Changed hasher.write to hasher.update and removed flush calls |
| crates/crypto/src/encdec/encrypt.rs | Updated nonce generation to use generic array types |
| crates/crypto/src/encdec/decrypt.rs | Updated nonce handling with try_from pattern |
| crates/appauth/src/token.rs | Switched from OsRng to rand::rng() |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 19 out of 20 changed files in this pull request and generated 7 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Type of Change
Related Issues
Summary of Changes
This PR upgrades our cryptography dependencies to their latest release candidate versions, bringing improved security and performance.
Changes
AEAD Ciphers:
aes-gcm: 0.10.x → 0.11.0-rc.2 (addedrand_corefeature)chacha20poly1305: 0.10.x → 0.11.0-rc.2Key Derivation:
argon2: 0.5.x → 0.6.0-rc.2 (withstdsupport)pbkdf2: 0.12.x → 0.13.0-rc.2Hashing & MAC:
hmac: 0.12.x → 0.13.0-rc.3sha1: 0.10.x → 0.11.0-rc.3sha2: 0.10.x → 0.11.0-rc.3md-5: 0.10.x → 0.11.0-rc.3Asymmetric Crypto:
rsa: 0.9.x → 0.10.0-rc.10Benefits
✅ Enhanced security with latest cryptographic implementations
✅ Performance improvements in encryption/decryption operations
✅ Better compatibility with modern cryptographic standards
✅ No breaking changes to existing KMS functionality
Testing
Checklist
Cargo.tomlChecklist
make pre-commitImpact
Additional Notes
Thank you for your contribution! Please ensure your PR follows the community standards (CODE_OF_CONDUCT.md) and sign the CLA if this is your first contribution.