isoApplet: Prevent reading uninitialized values

CID 365823

Thanks coverity
This commit is contained in:
Jakub Jelen 2021-02-11 11:57:26 +01:00 committed by Frank Morgner
parent 2f232f217b
commit 1dbe4b5a5b
1 changed files with 2 additions and 1 deletions

View File

@ -358,6 +358,8 @@ isoApplet_generate_key_rsa(sc_pkcs15_prkey_info_t *key_info, sc_card_t *card,
LOG_FUNC_CALLED(card->ctx);
memset(&args, 0, sizeof(args));
/* Check key size: */
keybits = key_info->modulus_length;
if (keybits != 2048)
@ -370,7 +372,6 @@ isoApplet_generate_key_rsa(sc_pkcs15_prkey_info_t *key_info, sc_card_t *card,
/* Generate the key.
* Note: key size is not explicitly passed to the card.
* It assumes 2048 along with the algorithm reference. */
memset(&args, 0, sizeof(args));
args.algorithm_ref = SC_ISOAPPLET_ALG_REF_RSA_GEN_2048;
args.priv_key_ref = key_info->key_reference;