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 {
274274
275275 let public_key: RsaPublicKey = picky_asn1_der:: from_bytes ( & op. data ) . or_else ( |e| {
276276 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+ ) ?;
277283 Err ( ResponseStatus :: PsaErrorInvalidArgument )
278284 } ) ?;
279285
280286 if public_key. modulus . is_negative ( ) || public_key. public_exponent . is_negative ( ) {
281287 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+ ) ?;
282294 return Err ( ResponseStatus :: PsaErrorInvalidArgument ) ;
283295 }
284296
You can’t perform that action at this time.
0 commit comments