File tree Expand file tree Collapse file tree 3 files changed +9
-27
lines changed
tests/per_provider/normal_tests Expand file tree Collapse file tree 3 files changed +9
-27
lines changed Original file line number Diff line number Diff line change @@ -143,10 +143,11 @@ fn failed_created_key_should_be_removed() -> Result<()> {
143
143
} ;
144
144
145
145
// Unsupported parameter, should fail
146
- if client. generate_key ( key_name. clone ( ) , attributes) . is_err ( ) {
147
- // The key should not exist anymore in the KIM
148
- client. generate_rsa_sign_key ( key_name) ?;
149
- }
146
+ let _ = client
147
+ . generate_key ( key_name. clone ( ) , attributes)
148
+ . unwrap_err ( ) ;
149
+ // The key should not exist anymore in the KIM
150
+ client. generate_rsa_sign_key ( key_name) ?;
150
151
151
152
Ok ( ( ) )
152
153
}
Original file line number Diff line number Diff line change @@ -85,21 +85,6 @@ fn check_public_rsa_export_format() -> Result<()> {
85
85
Ok ( ( ) )
86
86
}
87
87
88
- #[ test]
89
- fn check_public_rsa_export_format2 ( ) -> Result < ( ) > {
90
- // Same test but with a RsaPublicKey
91
- let mut client = TestClient :: new ( ) ;
92
- let key_name = String :: from ( "check_public_rsa_export_format2" ) ;
93
-
94
- client. generate_rsa_sign_key ( key_name. clone ( ) ) ?;
95
-
96
- let public_key = client. export_public_key ( key_name) ?;
97
-
98
- // That should not fail if the bytes are in the expected format.
99
- let _public_key: RsaPublicKey = picky_asn1_der:: from_bytes ( & public_key) . unwrap ( ) ;
100
- Ok ( ( ) )
101
- }
102
-
103
88
#[ test]
104
89
fn check_export_public_possible ( ) -> Result < ( ) > {
105
90
// Exporting a public key is always permitted
Original file line number Diff line number Diff line change @@ -198,8 +198,6 @@ fn check_format_import3() -> Result<()> {
198
198
199
199
#[ test]
200
200
fn failed_imported_key_should_be_removed ( ) -> Result < ( ) > {
201
- // If the key_bits field of the key attributes is zero, the operation should still work.
202
- // The size of the key is always taken from the data parameter.
203
201
let mut client = TestClient :: new ( ) ;
204
202
let key_name = String :: from ( "failed_imported_key_should_be_removed" ) ;
205
203
@@ -231,13 +229,11 @@ fn failed_imported_key_should_be_removed() -> Result<()> {
231
229
} ,
232
230
} ;
233
231
234
- if client
232
+ let _ = client
235
233
. import_key ( key_name. clone ( ) , attributes, Vec :: new ( ) )
236
- . is_err ( )
237
- {
238
- // Should succeed because key would have been destroyed.
239
- client. import_rsa_public_key ( key_name, picky_asn1_der:: to_vec ( & public_key) . unwrap ( ) ) ?;
240
- }
234
+ . unwrap_err ( ) ;
235
+ // Should succeed because key would have been destroyed.
236
+ client. import_rsa_public_key ( key_name, picky_asn1_der:: to_vec ( & public_key) . unwrap ( ) ) ?;
241
237
242
238
Ok ( ( ) )
243
239
}
You can’t perform that action at this time.
0 commit comments