wolfcrypt/src/asn.c wc_BuildEccKeyDer(): fix for clang-analyzer-deadcode.DeadStores.

This commit is contained in:
Daniel Pouzzner
2022-06-28 19:14:58 -05:00
parent 90aaeb283e
commit 5adf7e4eb7

View File

@@ -29351,6 +29351,7 @@ static int wc_BuildEccKeyDer(ecc_key* key, byte* output, word32 *inLen,
SetASNItem_NoOutNode(dataASN, eccKeyASN, ECCKEYASN_IDX_PARAMS, SetASNItem_NoOutNode(dataASN, eccKeyASN, ECCKEYASN_IDX_PARAMS,
eccKeyASN_Length); eccKeyASN_Length);
} }
if (ret == 0) {
if (pubIn) { if (pubIn) {
/* Leave space for public key. */ /* Leave space for public key. */
SetASN_Buffer(&dataASN[ECCKEYASN_IDX_PUBKEY_VAL], NULL, pubSz); SetASN_Buffer(&dataASN[ECCKEYASN_IDX_PUBKEY_VAL], NULL, pubSz);
@@ -29363,6 +29364,7 @@ static int wc_BuildEccKeyDer(ecc_key* key, byte* output, word32 *inLen,
/* Calculate size of the private key encoding. */ /* Calculate size of the private key encoding. */
ret = SizeASN_Items(eccKeyASN, dataASN, eccKeyASN_Length, &sz); ret = SizeASN_Items(eccKeyASN, dataASN, eccKeyASN_Length, &sz);
} }
}
/* Return the size if no buffer. */ /* Return the size if no buffer. */
if ((ret == 0) && (output == NULL)) { if ((ret == 0) && (output == NULL)) {
*inLen = sz; *inLen = sz;