Skip to content

Commit

Permalink
Merge pull request #7336 from douzzer/20240314-fix-armasm-sha256
Browse files Browse the repository at this point in the history
20240314 -- fix -Wconversions in asn.c
  • Loading branch information
SparkiDev authored Mar 15, 2024
2 parents e3fc43c + 25efe6b commit 8684caa
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions wolfcrypt/src/asn.c
Original file line number Diff line number Diff line change
Expand Up @@ -1128,9 +1128,9 @@ static int GetASN_BitString(const byte* input, word32 idx, int length)
static int GetASN_UTF8String(const byte* input, word32 idx, int length)
{
int ret = 0;
int i = 0;
word32 i = 0;

while ((ret == 0) && (i < length)) {
while ((ret == 0) && ((int)i < length)) {
int cnt;

/* Check code points and get count of following bytes. */
Expand All @@ -1157,7 +1157,7 @@ static int GetASN_UTF8String(const byte* input, word32 idx, int length)
/* Check each following byte. */
for (; cnt > 0; cnt--) {
/* Check we have enough data. */
if (i == length) {
if ((int)i == length) {
WOLFSSL_MSG("Missing character in UTF8STRING\n");
ret = ASN_PARSE_E;
break;
Expand Down Expand Up @@ -1202,7 +1202,7 @@ static int GetASN_ObjectId(const byte* input, word32 idx, int length)
/* Last octet of a subidentifier has bit 8 clear. Last octet must be last
* of a subidentifier. Ensure last octet hasn't got top bit set indicating.
*/
else if ((input[idx + length - 1] & 0x80) != 0x00) {
else if ((input[(int)idx + length - 1] & 0x80) != 0x00) {
WOLFSSL_MSG("OID last octet has top bit set");
ret = ASN_PARSE_E;
}
Expand Down

0 comments on commit 8684caa

Please sign in to comment.