mirror of
https://github.com/str4d/rage.git
synced 2025-04-07 04:47:42 +03:00
age: Make scrypt::Identity
an owning type
This commit is contained in:
parent
0c2acd5306
commit
4ba982254c
2 changed files with 4 additions and 4 deletions
|
@ -108,7 +108,7 @@ impl<R> PassphraseDecryptor<R> {
|
|||
max_work_factor: Option<u8>,
|
||||
) -> Result<PayloadKey, DecryptError> {
|
||||
let identity = scrypt::Identity {
|
||||
passphrase,
|
||||
passphrase: passphrase.clone(),
|
||||
max_work_factor,
|
||||
};
|
||||
|
||||
|
|
|
@ -112,12 +112,12 @@ impl crate::Recipient for Recipient {
|
|||
}
|
||||
}
|
||||
|
||||
pub(crate) struct Identity<'a> {
|
||||
pub(crate) passphrase: &'a SecretString,
|
||||
pub(crate) struct Identity {
|
||||
pub(crate) passphrase: SecretString,
|
||||
pub(crate) max_work_factor: Option<u8>,
|
||||
}
|
||||
|
||||
impl<'a> crate::Identity for Identity<'a> {
|
||||
impl crate::Identity for Identity {
|
||||
fn unwrap_stanza(&self, stanza: &Stanza) -> Option<Result<FileKey, DecryptError>> {
|
||||
if stanza.tag != SCRYPT_RECIPIENT_TAG {
|
||||
return None;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue