Generalize base64 decode method, allow all formats for single method

This commit is contained in:
timvisee 2018-03-20 22:46:36 +01:00
parent 4957c98f6d
commit a7da14ec2c
No known key found for this signature in database
GPG key ID: 109CBA0BF74036C2
4 changed files with 15 additions and 18 deletions

View file

@ -181,7 +181,7 @@ impl DownloadFile {
.ok_or(FileParseError::InvalidSecret)?
.get(1)
{
secret = b64::decode_url(raw.as_str().trim())
secret = b64::decode(raw.as_str().trim())
.map_err(|_| FileParseError::InvalidSecret)?
}
}

View file

@ -51,7 +51,7 @@ impl Metadata {
// TODO: use an input vector length from a constant
pub fn iv(&self) -> [u8; 12] {
// Decode the input vector
let decoded = b64::decode_url(&self.iv).unwrap();
let decoded = b64::decode(&self.iv).unwrap();
// Create a sized array
*array_ref!(decoded, 0, 12)