mirror of
https://github.com/timvisee/ffsend.git
synced 2025-10-05 18:24:18 +02:00
Generalize base64 decode method, allow all formats for single method
This commit is contained in:
parent
4957c98f6d
commit
a7da14ec2c
4 changed files with 15 additions and 18 deletions
|
@ -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)?
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue