File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Expand file tree Collapse file tree 2 files changed +8
-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 @@ -1197,8 +1197,11 @@ fn get_attribute_info_test() -> TestResult {
11971197 session. generate_key_pair ( & mechanism, & pub_key_template, & priv_key_template) ?;
11981198
11991199 let pub_attribs = vec ! [ AttributeType :: PublicExponent , AttributeType :: Modulus ] ;
1200- let mut priv_attribs = pub_attribs. clone ( ) ;
1201- priv_attribs. push ( AttributeType :: PrivateExponent ) ;
1200+ let mut priv_attribs = [
1201+ AttributeType :: PublicExponent ,
1202+ AttributeType :: Modulus ,
1203+ AttributeType :: PrivateExponent ,
1204+ ] ;
12021205
12031206 let attrib_info = session. get_attribute_info ( public, & pub_attribs) ?;
12041207 let hash = pub_attribs
@@ -1239,7 +1242,7 @@ fn get_attribute_info_test() -> TestResult {
12391242 _ => panic ! ( "Private Exponent of RSA private key should be sensitive" ) ,
12401243 }
12411244
1242- let hash = session. get_attribute_info_map ( private, priv_attribs) ?;
1245+ let hash = session. get_attribute_info_map ( private, & priv_attribs) ?;
12431246 if let AttributeInfo :: Available ( size) = hash[ & AttributeType :: Modulus ] {
12441247 assert_eq ! ( size, 2048 / 8 ) ;
12451248 } else {
You can’t perform that action at this time.
0 commit comments