File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
src/providers/pkcs11_provider Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -274,11 +274,23 @@ impl Pkcs11Provider {
274
274
275
275
let public_key: RsaPublicKey = picky_asn1_der:: from_bytes ( & op. data ) . or_else ( |e| {
276
276
format_error ! ( "Failed to parse RsaPublicKey data" , e) ;
277
+ remove_key_id (
278
+ & key_triple,
279
+ key_id,
280
+ & mut * store_handle,
281
+ & mut local_ids_handle,
282
+ ) ?;
277
283
Err ( ResponseStatus :: PsaErrorInvalidArgument )
278
284
} ) ?;
279
285
280
286
if public_key. modulus . is_negative ( ) || public_key. public_exponent . is_negative ( ) {
281
287
error ! ( "Only positive modulus and public exponent are supported." ) ;
288
+ remove_key_id (
289
+ & key_triple,
290
+ key_id,
291
+ & mut * store_handle,
292
+ & mut local_ids_handle,
293
+ ) ?;
282
294
return Err ( ResponseStatus :: PsaErrorInvalidArgument ) ;
283
295
}
284
296
You can’t perform that action at this time.
0 commit comments