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

Add logging for decryption failures (#11683)

* Add logging to decryption routines

* Fix case of uknown encryption type

* Remove enum to string mapping
This commit is contained in:
Bernd Schoolmann
2024-10-24 15:43:49 +02:00
committed by GitHub
parent 9b471e6633
commit b3b311e164
2 changed files with 57 additions and 10 deletions

View File

@@ -8,6 +8,14 @@ export enum EncryptionType {
Rsa2048_OaepSha1_HmacSha256_B64 = 6,
}
export function encryptionTypeToString(encryptionType: EncryptionType): string {
if (encryptionType in EncryptionType) {
return EncryptionType[encryptionType];
} else {
return "Unknown encryption type " + encryptionType;
}
}
/** The expected number of parts to a serialized EncString of the given encryption type.
* For example, an EncString of type AesCbc256_B64 will have 2 parts, and an EncString of type
* AesCbc128_HmacSha256_B64 will have 3 parts.