warning fixes

This commit is contained in:
toddouska 2011-10-11 12:06:04 -07:00
parent 2021461d7c
commit 494d048980
5 changed files with 14 additions and 9 deletions

View File

@ -3142,7 +3142,6 @@ static int SetAltNamesFromCert(Cert* cert, const byte* der, int derSz)
{ {
DecodedCert decoded; DecodedCert decoded;
int ret; int ret;
int sz;
if (derSz < 0) if (derSz < 0)
return derSz; return derSz;
@ -3202,7 +3201,7 @@ static int SetAltNamesFromCert(Cert* cert, const byte* der, int derSz)
if (oid == ALT_NAMES_OID) { if (oid == ALT_NAMES_OID) {
cert->altNamesSz = length + (tmpIdx - startIdx); cert->altNamesSz = length + (tmpIdx - startIdx);
if (cert->altNamesSz < sizeof(cert->altNames)) if (cert->altNamesSz < (int)sizeof(cert->altNames))
XMEMCPY(cert->altNames, &decoded.source[startIdx], XMEMCPY(cert->altNames, &decoded.source[startIdx],
cert->altNamesSz); cert->altNamesSz);
else { else {

View File

@ -1241,6 +1241,9 @@ void fp_mul_comba_small(fp_int *A, fp_int *B, fp_int *C)
fp_clamp(C); fp_clamp(C);
COMBA_FINI; COMBA_FINI;
break; break;
default:
break;
} }
} }

View File

@ -1531,6 +1531,9 @@ void fp_sqr_comba_small(fp_int *A, fp_int *B)
memcpy(B->dp, b, 32 * sizeof(fp_digit)); memcpy(B->dp, b, 32 * sizeof(fp_digit));
fp_clamp(B); fp_clamp(B);
break; break;
default:
break;
} }
} }

View File

@ -646,8 +646,6 @@ int mp_read_unsigned_bin (mp_int * a, const unsigned char *b, int c);
int mp_to_unsigned_bin (mp_int * a, unsigned char *b); int mp_to_unsigned_bin (mp_int * a, unsigned char *b);
#ifdef HAVE_ECC #ifdef HAVE_ECC
int mp_sqrmod(mp_int* a, mp_int* b, mp_int* c);
int mp_montgomery_calc_normalization(mp_int *a, mp_int *b);
int mp_read_radix(mp_int* a, const char* str, int radix); int mp_read_radix(mp_int* a, const char* str, int radix);
int mp_iszero(mp_int* a); int mp_iszero(mp_int* a);
int mp_set(fp_int *a, fp_digit b); int mp_set(fp_int *a, fp_digit b);
@ -660,6 +658,8 @@ int mp_to_unsigned_bin (mp_int * a, unsigned char *b);
#if defined(HAVE_ECC) || defined(CYASSL_KEY_GEN) #if defined(HAVE_ECC) || defined(CYASSL_KEY_GEN)
int mp_copy(fp_int* a, fp_int* b); int mp_copy(fp_int* a, fp_int* b);
int mp_sqrmod(mp_int* a, mp_int* b, mp_int* c);
int mp_montgomery_calc_normalization(mp_int *a, mp_int *b);
#endif #endif
#ifdef CYASSL_KEY_GEN #ifdef CYASSL_KEY_GEN

View File

@ -4206,7 +4206,7 @@ byte* CyaSSL_get_chain_cert(CYASSL_X509_CHAIN* chain, int idx)
/* Get peer's PEM ceritifcate at index (idx), output to buffer if inLen big /* Get peer's PEM ceritifcate at index (idx), output to buffer if inLen big
enough else return error (-1), output length is in *outLen */ enough else return error (-1), output length is in *outLen */
int CyaSSL_get_chain_cert_pem(CYASSL_X509_CHAIN* chain, int idx, int CyaSSL_get_chain_cert_pem(CYASSL_X509_CHAIN* chain, int idx,
unsigned char* buffer, int inLen, int* outLen) unsigned char* buf, int inLen, int* outLen)
{ {
const char header[] = "-----BEGIN CERTIFICATE-----\n"; const char header[] = "-----BEGIN CERTIFICATE-----\n";
const char footer[] = "-----END CERTIFICATE-----\n"; const char footer[] = "-----END CERTIFICATE-----\n";
@ -4217,7 +4217,7 @@ int CyaSSL_get_chain_cert_pem(CYASSL_X509_CHAIN* chain, int idx,
int err; int err;
CYASSL_ENTER("CyaSSL_get_chain_cert_pem"); CYASSL_ENTER("CyaSSL_get_chain_cert_pem");
if (!chain || !outLen || !buffer) if (!chain || !outLen || !buf)
return BAD_FUNC_ARG; return BAD_FUNC_ARG;
/* don't even try if inLen too short */ /* don't even try if inLen too short */
@ -4225,20 +4225,20 @@ int CyaSSL_get_chain_cert_pem(CYASSL_X509_CHAIN* chain, int idx,
return BAD_FUNC_ARG; return BAD_FUNC_ARG;
/* header */ /* header */
XMEMCPY(buffer, header, headerLen); XMEMCPY(buf, header, headerLen);
i = headerLen; i = headerLen;
/* body */ /* body */
*outLen = inLen; /* input to Base64Encode */ *outLen = inLen; /* input to Base64Encode */
if ( (err = Base64Encode(chain->certs[idx].buffer, chain->certs[idx].length, if ( (err = Base64Encode(chain->certs[idx].buffer, chain->certs[idx].length,
buffer + i, (word32*)outLen)) < 0) buf + i, (word32*)outLen)) < 0)
return err; return err;
i += *outLen; i += *outLen;
/* footer */ /* footer */
if ( (i + footerLen) > inLen) if ( (i + footerLen) > inLen)
return BAD_FUNC_ARG; return BAD_FUNC_ARG;
XMEMCPY(buffer + i, footer, footerLen); XMEMCPY(buf + i, footer, footerLen);
*outLen += headerLen + footerLen; *outLen += headerLen + footerLen;
return 0; return 0;