File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11use serde:: { Deserialize , Serialize } ;
22use zbus:: zvariant:: Type ;
3- use zeroize:: { Zeroize , ZeroizeOnDrop , Zeroizing } ;
3+ use zeroize:: { Zeroize , ZeroizeOnDrop } ;
44
55use crate :: { Key , crypto} ;
66
@@ -9,8 +9,8 @@ use crate::{Key, crypto};
99pub struct AttributeValue ( String ) ;
1010
1111impl AttributeValue {
12- pub ( crate ) fn mac ( & self , key : & Key ) -> Result < Zeroizing < Vec < u8 > > , crate :: crypto:: Error > {
13- Ok ( Zeroizing :: new ( crypto:: compute_mac ( self . 0 . as_bytes ( ) , key) ? ) )
12+ pub ( crate ) fn mac ( & self , key : & Key ) -> Result < Vec < u8 > , crate :: crypto:: Error > {
13+ crypto:: compute_mac ( self . 0 . as_bytes ( ) , key)
1414 }
1515}
1616
Original file line number Diff line number Diff line change @@ -154,7 +154,7 @@ impl Item {
154154 let hashed_attributes = self
155155 . attributes
156156 . iter ( )
157- . filter_map ( |( k, v) | Some ( ( k. to_owned ( ) , v. mac ( key) . ok ( ) ?. as_slice ( ) . into ( ) ) ) )
157+ . filter_map ( |( k, v) | Some ( ( k. to_owned ( ) , v. mac ( key) . ok ( ) ?) ) )
158158 . collect ( ) ;
159159
160160 Ok ( EncryptedItem {
Original file line number Diff line number Diff line change @@ -63,10 +63,7 @@ pub trait AsAttributes {
6363 fn hash < ' a > (
6464 & ' a self ,
6565 key : & Key ,
66- ) -> Vec < (
67- & ' a str ,
68- std:: result:: Result < zeroize:: Zeroizing < Vec < u8 > > , crate :: crypto:: Error > ,
69- ) > {
66+ ) -> Vec < ( & ' a str , std:: result:: Result < Vec < u8 > , crate :: crypto:: Error > ) > {
7067 self . as_attributes ( )
7168 . into_iter ( )
7269 . map ( |( k, v) | ( k, crate :: file:: AttributeValue :: from ( v) . mac ( key) ) )
You can’t perform that action at this time.
0 commit comments