Fixes issue with uninitialized `caKey` found with valgrind reported in ZD 13212.

pull/277/head
David Garske 2021-11-29 07:10:35 -08:00
parent 7931f0dff5
commit 7212062235
1 changed files with 4 additions and 1 deletions

View File

@ -163,10 +163,13 @@ static int do_csrsign(int argc, char** argv)
}
printf("Loading CA key to ecc_key struct\n");
ret = wc_ecc_init(&caKey);
if (ret != 0) goto exit;
initCaKey = 1;
idx = 0;
ret = wc_EccPrivateKeyDecode(derBuf, &idx, &caKey, derSz);
if (ret != 0) goto exit;
initCaKey = 1;
/*---------------------------------------------------------------------------*/
/* Load CSR PEM */