[PM-32439] Consolidate safe module cryptographic namespacing strategy#770
[PM-32439] Consolidate safe module cryptographic namespacing strategy#770
Conversation
|
Great job! No new security vulnerabilities introduced in this pull request |
🔍 SDK Breaking Change Detection ResultsSDK Version:
Breaking change detection completed. View SDK workflow |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #770 +/- ##
==========================================
+ Coverage 82.05% 82.07% +0.02%
==========================================
Files 331 332 +1
Lines 38348 38514 +166
==========================================
+ Hits 31466 31610 +144
- Misses 6882 6904 +22 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
96c814a to
9f988f2
Compare
a267c1d to
db20456
Compare
crates/bitwarden-crypto/src/cose.rs
Outdated
| /// The label used for the namespace ensuring strong domain separation when using data envelopes. | ||
| pub(crate) const DATA_ENVELOPE_NAMESPACE: i64 = -80001; | ||
| // The label used for defining the namespace of a signed object | ||
| pub(crate) const SIGNING_NAMESPACE: i64 = 80000; |
There was a problem hiding this comment.
Keeping signing namespace a separate layer. It spans a separate namespace that does not just include safe objects.
|




🎟️ Tracking
https://bitwarden.atlassian.net/browse/PM-32439
📔 Objective
Expands the cryptographic namespace separation to follow a clearer strategy. Specifically, there are now two layers of namespace separation, the object layer and the content layer. On the object layer we partition the cryptographic primitives (Encrypt0, Sign1) into safe primitives (DataEnvelope, PasswordProtectedKeyEnvelope, etc). On the content layer, we partition each of the above subsets further, by use-case. For example, a valid partitioning for PasswordProtectedKeyEnvelope would be {MasterPassword, Pin}.
This prevents a class of attacks where the server switches cryptographic objects, signed/encrypted under the same key. This eliminates any kind of cryptographic analysis that would be needed to prevent the above attacks / limits security analysis to each sub-namespace spanned by the combination of the object and content namespace layer.
🚨 Breaking Changes