File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -486,9 +486,9 @@ impl Session {
486486 pub fn get_attribute_info_map (
487487 & self ,
488488 object : ObjectHandle ,
489- attributes : Vec < AttributeType > ,
489+ attributes : & [ AttributeType ] ,
490490 ) -> Result < HashMap < AttributeType , AttributeInfo > > {
491- let attrib_info = self . get_attribute_info ( object, attributes. as_slice ( ) ) ?;
491+ let attrib_info = self . get_attribute_info ( object, attributes) ?;
492492
493493 Ok ( attributes
494494 . iter ( )
Original file line number Diff line number Diff line change @@ -1192,8 +1192,9 @@ fn get_attribute_info_test() -> TestResult {
11921192 session. generate_key_pair ( & mechanism, & pub_key_template, & priv_key_template) ?;
11931193
11941194 let pub_attribs = vec ! [ AttributeType :: PublicExponent , AttributeType :: Modulus ] ;
1195- let mut priv_attribs = pub_attribs. clone ( ) ;
1196- priv_attribs. push ( AttributeType :: PrivateExponent ) ;
1195+ let mut priv_attribs = [
1196+ AttributeType :: PublicExponent , AttributeType :: Modulus , AttributeType :: PrivateExponent
1197+ ] ;
11971198
11981199 let attrib_info = session. get_attribute_info ( public, & pub_attribs) ?;
11991200 let hash = pub_attribs
@@ -1234,7 +1235,7 @@ fn get_attribute_info_test() -> TestResult {
12341235 _ => panic ! ( "Private Exponent of RSA private key should be sensitive" ) ,
12351236 }
12361237
1237- let hash = session. get_attribute_info_map ( private, priv_attribs) ?;
1238+ let hash = session. get_attribute_info_map ( private, & priv_attribs) ?;
12381239 if let AttributeInfo :: Available ( size) = hash[ & AttributeType :: Modulus ] {
12391240 assert_eq ! ( size, 2048 / 8 ) ;
12401241 } else {
You can’t perform that action at this time.
0 commit comments