Skip to content

Commit d8e9e90

Browse files
committed
refactor rawLen to avoid unused warning
1 parent 7c0423e commit d8e9e90

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

wolfcrypt/src/asn.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25938,13 +25938,13 @@ int wc_RsaKeyToDer(RsaKey* key, byte* output, word32 inLen)
2593825938
#ifndef WOLFSSL_ASN_TEMPLATE
2593925939
int ret = 0, i;
2594025940
int mpSz;
25941-
word32 rawLen;
2594225941
word32 seqSz = 0, verSz = 0, intTotalLen = 0, outLen = 0;
2594325942
word32 sizes[RSA_INTS];
2594425943
byte seq[MAX_SEQ_SZ];
2594525944
byte ver[MAX_VERSION_SZ];
2594625945
mp_int* keyInt;
2594725946
#ifndef WOLFSSL_NO_MALLOC
25947+
word32 rawLen;
2594825948
byte* tmps[RSA_INTS];
2594925949
#endif
2595025950

@@ -25965,9 +25965,9 @@ int wc_RsaKeyToDer(RsaKey* key, byte* output, word32 inLen)
2596525965
ret = mp_unsigned_bin_size(keyInt);
2596625966
if (ret < 0)
2596725967
break;
25968+
#ifndef WOLFSSL_NO_MALLOC
2596825969
rawLen = (word32)ret + 1;
2596925970
ret = 0;
25970-
#ifndef WOLFSSL_NO_MALLOC
2597125971
if (output != NULL) {
2597225972
tmps[i] = (byte*)XMALLOC(rawLen + MAX_SEQ_SZ, key->heap,
2597325973
DYNAMIC_TYPE_RSA);
@@ -25978,6 +25978,7 @@ int wc_RsaKeyToDer(RsaKey* key, byte* output, word32 inLen)
2597825978
}
2597925979
mpSz = SetASNIntMP(keyInt, MAX_RSA_INT_SZ, tmps[i]);
2598025980
#else
25981+
ret = 0;
2598125982
mpSz = SetASNIntMP(keyInt, MAX_RSA_INT_SZ, NULL);
2598225983
#endif
2598325984
if (mpSz < 0) {

0 commit comments

Comments
 (0)