mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-30 10:47:28 +02:00
Fix compiler warnings (ZD12802 and others)
This commit is contained in:
@ -6817,7 +6817,7 @@ int DecryptContent(byte* input, word32 sz, const char* password, int passwordSz)
|
|||||||
{
|
{
|
||||||
#ifndef WOLFSSL_ASN_TEMPLATE
|
#ifndef WOLFSSL_ASN_TEMPLATE
|
||||||
word32 inOutIdx = 0, seqEnd, oid, shaOid = 0;
|
word32 inOutIdx = 0, seqEnd, oid, shaOid = 0;
|
||||||
int ret = 0, first, second, length = 0, version, saltSz, id;
|
int ret = 0, first, second, length = 0, version, saltSz, id = 0;
|
||||||
int iterations = 0, keySz = 0;
|
int iterations = 0, keySz = 0;
|
||||||
#ifdef WOLFSSL_SMALL_STACK
|
#ifdef WOLFSSL_SMALL_STACK
|
||||||
byte* salt = NULL;
|
byte* salt = NULL;
|
||||||
|
@ -93,14 +93,14 @@ static int hex_to_bytes(const char *hex, unsigned char *output, unsigned long sz
|
|||||||
{
|
{
|
||||||
word32 i;
|
word32 i;
|
||||||
for (i = 0; i < sz; i++) {
|
for (i = 0; i < sz; i++) {
|
||||||
char ch1, ch2;
|
signed char ch1, ch2;
|
||||||
ch1 = HexCharToByte(hex[i * 2]);
|
ch1 = HexCharToByte(hex[i * 2]);
|
||||||
ch2 = HexCharToByte(hex[i * 2 + 1]);
|
ch2 = HexCharToByte(hex[i * 2 + 1]);
|
||||||
if (ch1 < 0 || ch2 < 0) {
|
if ((ch1 < 0) || (ch2 < 0)) {
|
||||||
WOLFSSL_MSG("hex_to_bytes: syntax error");
|
WOLFSSL_MSG("hex_to_bytes: syntax error");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
output[i] = (ch1 << 4) + ch2;
|
output[i] = (unsigned char)((ch1 << 4) + ch2);
|
||||||
}
|
}
|
||||||
return (int)sz;
|
return (int)sz;
|
||||||
}
|
}
|
||||||
@ -157,7 +157,6 @@ static int expect_ok(const char *cmd, int size)
|
|||||||
/* Conversion utility from hex string format to bytes */
|
/* Conversion utility from hex string format to bytes */
|
||||||
static int hexbuffer_conv(char *hex_str, unsigned char *output, unsigned long sz)
|
static int hexbuffer_conv(char *hex_str, unsigned char *output, unsigned long sz)
|
||||||
{
|
{
|
||||||
int ret;
|
|
||||||
if (XSTRLEN(hex_str) != (2 * sz)) {
|
if (XSTRLEN(hex_str) != (2 * sz)) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user