diff options
Diffstat (limited to 'src/cipherstring.rs')
-rw-r--r-- | src/cipherstring.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/cipherstring.rs b/src/cipherstring.rs index 7aaaf9f..7f9ce31 100644 --- a/src/cipherstring.rs +++ b/src/cipherstring.rs @@ -66,7 +66,11 @@ impl CipherString { mac, }) } - 4 => { + 4 | 6 => { + // the only difference between 4 and 6 is the HMAC256 signature appended at the end + // https://github.com/bitwarden/jslib/blob/785b681f61f81690de6df55159ab07ae710bcfad/src/enums/encryptionType.ts#L8 + // format is: <cipher_text_b64>|<hmac_sig> + let contents = contents.split("|").next().unwrap(); let ciphertext = base64::decode(contents) .context(crate::error::InvalidBase64)?; Ok(Self::Asymmetric { ciphertext }) |