diff --git a/Cargo.toml b/Cargo.toml index 2da98cb..453d159 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,10 +14,10 @@ default = [] macos-specify-keychain = [] [target.'cfg(target_os = "macos")'.dependencies] -security-framework = "0.4.2" +security-framework = "2.0.0" [target.'cfg(target_os = "linux")'.dependencies] -secret-service = "1.1.1" +secret-service = "2.0.1" [target.'cfg(target_os = "windows")'.dependencies] byteorder = "1.2.1" @@ -25,7 +25,7 @@ winapi = { version = "0.3", features = ["wincred", "minwindef"] } [dev-dependencies] clap = "2.0.5" -rpassword = "2.0.0" +rpassword = "5.0.1" [target.'cfg(target_os = "macos")'.dev-dependencies] keychain-services = "0.1.1" diff --git a/src/error.rs b/src/error.rs index c041eaf..5c83ab6 100644 --- a/src/error.rs +++ b/src/error.rs @@ -1,5 +1,5 @@ #[cfg(target_os = "linux")] -use secret_service::SsError; +use secret_service::Error as SsError; #[cfg(target_os = "macos")] use security_framework::base::Error as SfError; use std::error; diff --git a/src/linux.rs b/src/linux.rs index 9e6b31c..15faeb0 100644 --- a/src/linux.rs +++ b/src/linux.rs @@ -29,7 +29,7 @@ impl<'a> Keyring<'a> { let label = &format!("Password for {} on {}", self.username, self.service)[..]; collection.create_item( label, - attrs, + attrs.into_iter().collect(), password.as_bytes(), true, // replace "text/plain", @@ -43,7 +43,7 @@ impl<'a> Keyring<'a> { if collection.is_locked()? { collection.unlock()?; } - let search = collection.search_items(self.attributes.clone())?; + let search = collection.search_items(self.attributes.iter().cloned().collect())?; let item = search.get(0).ok_or(KeyringError::NoPasswordFound)?; let secret_bytes = item.get_secret()?; let secret = String::from_utf8(secret_bytes)?; @@ -56,7 +56,7 @@ impl<'a> Keyring<'a> { if collection.is_locked()? { collection.unlock()?; } - let search = collection.search_items(self.attributes.clone())?; + let search = collection.search_items(self.attributes.iter().cloned().collect())?; let item = search.get(0).ok_or(KeyringError::NoPasswordFound)?; Ok(item.delete()?) }