-
Notifications
You must be signed in to change notification settings - Fork 25
[BEEEP] Update bitwarden-ssh RustCrypto dependencies, fixing imports of various SSH keys #536
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
base: main
Are you sure you want to change the base?
Conversation
|
Great job! No new security vulnerabilities introduced in this pull request |
|
Claude finished @quexten's task —— View job Code Review CompleteThis PR successfully updates Summary of Changes
Critical IssuesNone identified. Suggested ImprovementsFinding 1: Missing documentation comment explaining temporary dependency pinning The Cargo.toml pins RC versions that differ from workspace dependencies, but lacks a comment explaining this is temporary. This could lead to confusion during future dependency updates. Suggested addition (crates/bitwarden-ssh/Cargo.toml:27)[dependencies]
# NOTE: These dependencies are pinned to RustCrypto RC releases temporarily.
# They should be updated to match workspace versions once all crates are ready
# for the RustCrypto RC releases. See: PM-27518
bitwarden-error = { workspace = true }
bitwarden-vault = { workspace = true }Finding 2: Generator test coverage missing line Codecov reports 1 missing line in Contextfn create_rsa_key<R: CryptoRng + ?Sized>(
rng: &mut R,
bits: usize,
) -> Result<ssh_key::PrivateKey, error::KeyGenerationError> {
let rsa_keypair = ssh_key::private::RsaKeypair::random(rng, bits)
.map_err(KeyGenerationError::KeyGeneration)?;
let private_key =
ssh_key::PrivateKey::new(ssh_key::private::KeypairData::from(rsa_keypair), "")
.map_err(KeyGenerationError::KeyGeneration)?; // Line 54 - error path not tested
Ok(private_key)
}While achieving 100% coverage for error paths in key generation may not be practical (would require inducing cryptographic failures), consider adding a comment documenting why this error path isn't covered. Finding 3: Type parameter verbosity in PEM label matching The explicit type parameters Context (crates/bitwarden-ssh/src/import.rs:25-27)match label {
pkcs8::PrivateKeyInfo::<(), (), ()>::PEM_LABEL => import_pkcs8_key(encoded_key, None),
pkcs8::EncryptedPrivateKeyInfo::<()>::PEM_LABEL => import_pkcs8_key(This appears to be required due to API changes in pkcs8 0.11-rc. If these are the only valid type parameters for these types, consider filing an upstream issue to simplify the API, or add a comment explaining why these specific parameters are needed. Good Practices Observed
Action Items
PR Description QualityThe PR description is comprehensive and well-structured:
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #536 +/- ##
==========================================
+ Coverage 79.46% 79.47% +0.01%
==========================================
Files 302 302
Lines 32331 32335 +4
==========================================
+ Hits 25691 25698 +7
+ Misses 6640 6637 -3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
🔍 SDK Breaking Change Detection ResultsSDK Version:
Breaking change detection completed. View SDK workflow |

🎟️ Tracking
https://bitwarden.atlassian.net/browse/PM-27518
Fixes:
bitwarden/clients#17028
bitwarden/clients#14076
📔 Objective
Updates the
bitwarden-sshdependencies torcreleases from RustCrypto. This allows us to:It also replaces the RSA crate that has a vulnerability (timing attack) - though, it is unlikely that this actually affects import / was abusable.
RSA key generation test vectors are broken because the underlying RSA generation algorithm changed with rustcrypto's massive re-implementation of RSA, hence new test keys are provided.
Note: This pins the dependencies to be different from the workspace crates, as those are not yet ready to be updated. Eventually we will update those bit-by-bit too and then drop the dependency pinning.
⏰ Reminders before review
team
🦮 Reviewer guidelines
:+1:) or similar for great changes:memo:) or ℹ️ (:information_source:) for notes or general info:question:) for questions:thinking:) or 💭 (:thought_balloon:) for more open inquiry that's not quite a confirmedissue and could potentially benefit from discussion
:art:) for suggestions / improvements:x:) or:warning:) for more significant problems or concerns needing attention:seedling:) or ♻️ (:recycle:) for future improvements or indications of technical debt:pick:) for minor or nitpick changes