-
Notifications
You must be signed in to change notification settings - Fork 1.6k
[PM-28824] Catch error initializing provider keys #17672
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
|
Great job! No new security vulnerabilities introduced in this pull request |
|
Claude finished @quexten's task —— View job Code Review CompleteSummary: This PR adds error handling to prevent SDK initialization failure when deriving public keys from corrupted private keys. The change is focused and appropriate, addressing the critical issue where a corrupt private key would break SDK initialization. I've noted a couple of areas worth considering. FindingsFinding 1 (💭): Missing similar error handling in Finding 2 (💭): Error handling returns empty object - This achieves the goal of allowing SDK initialization, but users will have zero org keys available with only a log message. Consider if users need notification about org access failure. Finding 3 (💭): PR description scope - The description focuses on "provider keys" but the fix applies to all organization key encryption (both provider-encrypted and user-encrypted orgs), since the error can occur at PR Metadata✅ Title: Clear and specific The core fix is solid and addresses the blocking issue effectively. The inline comments highlight areas for discussion but don't block this hotfix. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #17672 +/- ##
==========================================
- Coverage 41.54% 41.54% -0.01%
==========================================
Files 3550 3550
Lines 102258 102260 +2
Branches 15341 15341
==========================================
- Hits 42486 42485 -1
- Misses 57982 57984 +2
- Partials 1790 1791 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|

🎟️ Tracking
https://bitwarden.atlassian.net/browse/PM-28824
📔 Objective
The key service derives the public key in order to encrypt provider keys to look like org keys. This was a hotfix that was introduced a few months ago in response to provider-key issues on SDK. If the private key fails to derive a public key, then this observable breaks, and the SDK never initializes. Thus, a corrupt private key would cause the the SDK domain decryption to fail.
📸 Screenshots
⏰ Reminders before review
🦮 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 confirmed issue 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