aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJake Swenson <jake@jakeswenson.com>2020-07-24 18:52:39 -0700
committerJake Swenson <jake@jakeswenson.com>2020-07-24 18:52:39 -0700
commit7d3129f80b1b2bc40a77e3e610fe09a412c0e0a8 (patch)
treee8fa66f65b6c7b59c816c0e9e65b54a13bfbf126 /src
parent0f2d4661bc4a0cdb0be9ba17449249f910c20229 (diff)
downloadrbw-7d3129f80b1b2bc40a77e3e610fe09a412c0e0a8.tar.gz
rbw-7d3129f80b1b2bc40a77e3e610fe09a412c0e0a8.zip
adding documentation
Diffstat (limited to 'src')
-rw-r--r--src/cipherstring.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/cipherstring.rs b/src/cipherstring.rs
index 151dea5..7f9ce31 100644
--- a/src/cipherstring.rs
+++ b/src/cipherstring.rs
@@ -67,6 +67,9 @@ impl CipherString {
})
}
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)?;