1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-22 03:03:43 +00:00

[PM-17900] Add cose / xchacha20poly1305 migration on userkey rotation (#14539)

* Add new encrypt service functions

* Undo changes

* Cleanup

* Fix build

* Fix comments

* Switch encrypt service to use SDK functions

* Add cose migration on userkey rotation

* Update sdk

* Set featureflag to default disabled

* Add tests

* Update sdk to build 168

* Make changes according to feedback
This commit is contained in:
Bernd Schoolmann
2025-05-20 21:25:14 +02:00
committed by GitHub
parent 7641dab0f0
commit d7c936e1ea
8 changed files with 133 additions and 27 deletions

View File

@@ -1,9 +1,16 @@
// FIXME: update to use a const object instead of a typescript enum
// eslint-disable-next-line @bitwarden/platform/no-enums
export enum EncryptionType {
// Symmetric encryption types
AesCbc256_B64 = 0,
// Type 1 was the unused and removed AesCbc128_HmacSha256_B64
AesCbc256_HmacSha256_B64 = 2,
// Cose is the encoding for the key used, but contained can be:
// - XChaCha20Poly1305
CoseEncrypt0 = 7,
// Asymmetric encryption types. These never occur in the same places that the symmetric ones would
// and can be split out into a separate enum.
Rsa2048_OaepSha256_B64 = 3,
Rsa2048_OaepSha1_B64 = 4,
Rsa2048_OaepSha256_HmacSha256_B64 = 5,
@@ -38,4 +45,5 @@ export const EXPECTED_NUM_PARTS_BY_ENCRYPTION_TYPE = {
[EncryptionType.Rsa2048_OaepSha1_B64]: 1,
[EncryptionType.Rsa2048_OaepSha256_HmacSha256_B64]: 2,
[EncryptionType.Rsa2048_OaepSha1_HmacSha256_B64]: 2,
[EncryptionType.CoseEncrypt0]: 1,
};