Skip to content

Commit 7df446b

Browse files
committed
cleanup: fix cast warning, and small cleanup.
1 parent 7faed6c commit 7df446b

1 file changed

Lines changed: 13 additions & 13 deletions

File tree

wolfcrypt/src/asn.c

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -40527,43 +40527,43 @@ enum {
4052740527
* @return ASN_UNKNOWN_OID_E when the OID cannot be verified.
4052840528
* @return MEMORY_E when dynamic memory allocation fails.
4052940529
* */
40530-
static int DecodeHolder(const byte* input, word32 len, DecodedAcert* cert)
40530+
static int DecodeHolder(const byte* input, word32 len, DecodedAcert* acert)
4053140531
{
4053240532
DECL_ASNGETDATA(dataASN, HolderASN_Length);
4053340533
int ret = 0;
4053440534
word32 idx = 0;
4053540535
word32 holderSerialSz = 0;
4053640536

40537-
if (input == NULL || len <= 0 || cert == NULL) {
40537+
if (input == NULL || len <= 0 || acert == NULL) {
4053840538
return BUFFER_E;
4053940539
}
4054040540

40541-
CALLOC_ASNGETDATA(dataASN, HolderASN_Length, ret, cert->heap);
40541+
CALLOC_ASNGETDATA(dataASN, HolderASN_Length, ret, acert->heap);
4054240542

4054340543
if (ret != 0) {
40544-
FREE_ASNGETDATA(dataASN, cert->heap);
40544+
FREE_ASNGETDATA(dataASN, acert->heap);
4054540545
return MEMORY_E;
4054640546
}
4054740547

4054840548
holderSerialSz = EXTERNAL_SERIAL_SIZE;
4054940549

40550-
GetASN_Buffer(&dataASN[HOLDER_IDX_SERIAL_INT], cert->holderSerial,
40550+
GetASN_Buffer(&dataASN[HOLDER_IDX_SERIAL_INT], acert->holderSerial,
4055140551
&holderSerialSz);
4055240552

4055340553
ret = GetASN_Items(HolderASN, dataASN, HolderASN_Length, 0, input,
4055440554
&idx, len);
4055540555

4055640556
if (ret != 0) {
4055740557
WOLFSSL_MSG("error: Holder: GetASN_Items failed");
40558-
FREE_ASNGETDATA(dataASN, cert->heap);
40558+
FREE_ASNGETDATA(dataASN, acert->heap);
4055940559
return ret;
4056040560
}
4056140561

4056240562
if (dataASN[HOLDER_IDX_SERIAL_INT].tag != 0) {
40563-
cert->holderSerialSz = holderSerialSz;
40563+
acert->holderSerialSz = (int)holderSerialSz;
4056440564
}
4056540565
else {
40566-
cert->holderSerialSz = 0;
40566+
acert->holderSerialSz = 0;
4056740567
}
4056840568

4056940569
{
@@ -40583,17 +40583,17 @@ static int DecodeHolder(const byte* input, word32 len, DecodedAcert* cert)
4058340583
gn_len = len;
4058440584
}
4058540585

40586-
ret = DecodeAcertGeneralNames(gn_input, gn_len, cert,
40587-
&cert->holderIssuerName);
40586+
ret = DecodeAcertGeneralNames(gn_input, gn_len, acert,
40587+
&acert->holderIssuerName);
4058840588

4058940589
if (ret != 0) {
4059040590
WOLFSSL_MSG("error: Holder: DecodeAcertGeneralNames failed");
40591-
FREE_ASNGETDATA(dataASN, cert->heap);
40591+
FREE_ASNGETDATA(dataASN, acert->heap);
4059240592
return ret;
4059340593
}
4059440594
}
4059540595

40596-
FREE_ASNGETDATA(dataASN, cert->heap);
40596+
FREE_ASNGETDATA(dataASN, acert->heap);
4059740597
return 0;
4059840598
}
4059940599

@@ -40856,7 +40856,7 @@ int ParseX509Acert(DecodedAcert* acert, int verify)
4085640856
}
4085740857

4085840858
acert->version = version;
40859-
acert->serialSz = serialSz;
40859+
acert->serialSz = (int)serialSz;
4086040860

4086140861
acert->signatureOID = dataASN[ACERT_IDX_ACINFO_ALGOID_OID].data.oid.sum;
4086240862
acert->certBegin = dataASN[ACERT_IDX_ACINFO_SEQ].offset;

0 commit comments

Comments
 (0)