mirror of
https://gitlab.gnome.org/World/Authenticator
synced 2024-06-30 22:54:31 +00:00
Compare commits
3 Commits
04078b81e8
...
d7b9602fd3
Author | SHA1 | Date | |
---|---|---|---|
|
d7b9602fd3 | ||
|
ca2054646a | ||
|
17f2b915c2 |
740
Cargo.lock
generated
740
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
|
@ -49,4 +49,4 @@ url = "2.2"
|
|||
uuid = {version = "1.0", features = ["v4"]}
|
||||
zbar-rust = "0.0"
|
||||
zeroize = {version = "1", features = ["zeroize_derive"]}
|
||||
zip = { version = "0.6.6", features = ["aes-crypto"] }
|
||||
zip = { version = "2.1", features = ["aes-crypto"] }
|
||||
|
|
|
@ -8,7 +8,7 @@ version = "0.1.0"
|
|||
data-encoding = "2.3"
|
||||
image = {version = "0.25", features = ["ico", "png"], default-features = false}
|
||||
percent-encoding = "2.1"
|
||||
quick-xml = "0.31"
|
||||
quick-xml = "0.33"
|
||||
reqwest = "0.12"
|
||||
svg_metadata = "0.5"
|
||||
tokio = {version = "1.0", default-features = false, features = ["rt-multi-thread", "fs", "io-util", "macros"]}
|
||||
|
|
|
@ -43,8 +43,9 @@ impl Scrapper {
|
|||
|
||||
fn from_string(body: String, base_url: Option<&Url>) -> Result<Self, Error> {
|
||||
let mut reader = quick_xml::Reader::from_str(&body);
|
||||
reader.check_end_names(false);
|
||||
reader.trim_markup_names_in_closing_tags(true);
|
||||
let config = reader.config_mut();
|
||||
config.check_end_names = false;
|
||||
config.trim_markup_names_in_closing_tags = true;
|
||||
|
||||
let mut icons = Self::from_reader(&mut reader, base_url);
|
||||
if let Some(base) = base_url {
|
||||
|
|
|
@ -117,7 +117,7 @@ impl Restorable for RaivoOTP {
|
|||
Some(k) => k.as_bytes(),
|
||||
};
|
||||
let mut archive = ZipArchive::new(Cursor::new(from))?;
|
||||
let file = archive.by_name_decrypt("raivo-otp-export.json", password)??;
|
||||
let file = archive.by_name_decrypt("raivo-otp-export.json", password)?;
|
||||
let items = serde_json::from_reader(file)?;
|
||||
Ok(items)
|
||||
}
|
||||
|
|
|
@ -10,7 +10,7 @@ use crate::{
|
|||
};
|
||||
|
||||
#[allow(clippy::upper_case_acronyms)]
|
||||
#[derive(Zeroize, ZeroizeOnDrop)]
|
||||
#[derive(Debug, PartialEq, Eq, Zeroize, ZeroizeOnDrop)]
|
||||
pub struct OTPUri {
|
||||
#[zeroize(skip)]
|
||||
pub(crate) algorithm: Algorithm,
|
||||
|
@ -251,4 +251,19 @@ mod tests {
|
|||
};
|
||||
assert_eq!(String::from(uri), "otpauth://totp/account%20test?secret=dznF36H0IIg17rK&issuer=Test&algorithm=SHA1&digits=6&period=30");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn ljl_issue() {
|
||||
let uri = OTPUri {
|
||||
algorithm: Algorithm::SHA512,
|
||||
label: "SpidItalia%3REDACTED@REDACTED (persona fisica)".to_owned(),
|
||||
secret: "REDACTED".to_owned(),
|
||||
issuer: "SpidItalia".to_owned(),
|
||||
method: Method::TOTP,
|
||||
digits: Some(6),
|
||||
period: Some(30),
|
||||
counter: None,
|
||||
};
|
||||
assert_eq!(OTPUri::from_str("otpauth://totp/SpidItalia%3REDACTED%40REDACTED%20(persona%20fisica)?period=30&digits=6&algorithm=SHA512&secret=REDACTED&issuer=SpidItalia").unwrap(), uri);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -258,6 +258,8 @@ impl AccountAddDialog {
|
|||
)
|
||||
.ok();
|
||||
|
||||
imp.provider_completion
|
||||
.set_model(Some(&self.model().completion_model()));
|
||||
self.set_provider(provider);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user