-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement parsing for all EncString ciphers #213
Conversation
No New Or Fixed Issues Found |
# Conflicts: # crates/bitwarden/src/crypto/enc_string.rs
("5" | "6", 1) => { | ||
let data = from_b64_vec(parts[0])?; | ||
if enc_type == "5" { | ||
Ok(EncString::Rsa2048_OaepSha256_HmacSha256_B64 { data }) | ||
} else { | ||
Ok(EncString::Rsa2048_OaepSha1_HmacSha256_B64 { data }) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this cleaner than just writing?
("5", 1) => {
Ok(EncString::Rsa2048_OaepSha256_HmacSha256_B64 { data: from_b64_vec(parts[0])? })
}
("6", 1) => {
Ok(EncString::Rsa2048_OaepSha1_HmacSha256_B64 { data: from_b64_vec(parts[0])? })
}
(Same also applies for ("3" | "4", 1)
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I kept it like it was previoulsy, but it's definitely not very useful now that most of the match branches are very short with the from_b64_vec
. We could even split ("1" | "2", 3)
as well, as it's only three lines now.
Type of change
Objective
Implement converting an EncString to and from a base64 encoded string and a buffer for all the ciphers we support. Added support for legacy EncStrings without a type header, just like the rest of the clients.
Marked RSA with HMAC as deprecated like the other clients. Also removed their mac fields, the other clients don't check them either.