age: Make scrypt::Identity an owning type

This commit is contained in:
Jack Grigg 2024-07-28 23:29:17 +00:00
parent 0c2acd5306
commit 4ba982254c
2 changed files with 4 additions and 4 deletions

View file

@ -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,
};

View file

@ -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;