lots o warning fixes for rc3

This commit is contained in:
toddouska 2011-09-28 13:19:05 -07:00
parent ab6ab40271
commit 27d35d50cc
10 changed files with 25 additions and 26 deletions

View File

@ -350,7 +350,7 @@ fi
# HC128
AC_ARG_ENABLE(hc128,
[ --enable-certgen Enable HC-128 (default: disabled)],
[ --enable-hc128 Enable HC-128 (default: disabled)],
[ ENABLED_HC128=$enableval ],
[ ENABLED_HC128=no ]
)
@ -358,6 +358,8 @@ AC_ARG_ENABLE(hc128,
if test "$ENABLED_HC128" = "no"
then
AM_CFLAGS="$AM_CFLAGS -DNO_HC128"
else
AM_CFLAGS="$AM_CFLAGS -DHAVE_HC128"
fi
AM_CONDITIONAL([BUILD_HC128], [test "x$ENABLED_HC128" = "xyes"])

View File

@ -75,7 +75,7 @@ int main(int argc, char** argv)
bench_aes(1);
#endif
bench_arc4();
#if HAVE_HC128
#ifdef HAVE_HC128
bench_hc128();
#endif
#ifndef NO_RABBIT
@ -204,7 +204,7 @@ void bench_arc4()
}
#if HAVE_HC128
#ifdef HAVE_HC128
void bench_hc128()
{
HC128 enc;

View File

@ -1194,8 +1194,10 @@ static int GetName(DecodedCert* cert, int nameType)
byte joint[2];
int oidSz;
if (GetSet(cert->source, &cert->srcIdx, &dummy, cert->maxIdx) < 0)
if (GetSet(cert->source, &cert->srcIdx, &dummy, cert->maxIdx) < 0) {
(void)b; /* empty body warning w/o messages enabled */
CYASSL_MSG("Cert name lacks set header, trying sequence");
}
if (GetSequence(cert->source, &cert->srcIdx, &dummy, cert->maxIdx) < 0)
return ASN_PARSE_E;

View File

@ -23,7 +23,7 @@
#include <config.h>
#endif
#if HAVE_HC128
#ifdef HAVE_HC128
#include <cyassl/ctaocrypt/hc128.h>
#ifdef NO_INLINE

View File

@ -752,7 +752,7 @@ int arc4_test()
int hc128_test()
{
#if defined(HAVE_HC128) && HAVE_HC128
#ifdef HAVE_HC128
byte cipher[16];
byte plain[16];

View File

@ -750,7 +750,7 @@ typedef union {
#ifdef BUILD_AES
Aes aes;
#endif
#if HAVE_HC128
#ifdef HAVE_HC128
HC128 hc128;
#endif
#ifdef BUILD_RABBIT

View File

@ -204,6 +204,7 @@ CYASSL_API long CyaSSL_CTX_set_session_cache_mode(CYASSL_CTX*, long);
/* only supports full name from cipher_name[] delimited by : */
CYASSL_API int CyaSSL_CTX_set_cipher_list(CYASSL_CTX*, const char*);
CYASSL_API int CyaSSL_ERR_GET_REASON(int err);
CYASSL_API char* CyaSSL_ERR_error_string(unsigned long,char*);
CYASSL_API void CyaSSL_ERR_error_string_n(unsigned long e, char* buf,
unsigned long sz);

View File

@ -53,9 +53,6 @@
#endif
int CyaSSL_negotiate(CYASSL*);
#ifndef NO_CYASSL_CLIENT
static int DoHelloVerifyRequest(CYASSL* ssl, const byte* input, word32*);
static int DoServerHello(CYASSL* ssl, const byte* input, word32*);
@ -807,9 +804,6 @@ int InitSSL(CYASSL* ssl, CYASSL_CTX* ctx)
}
int CyaSSL_BIO_free(CYASSL_BIO*); /* internal doesn't have */
/* In case holding SSL object in array and don't want to free actual ssl */
void SSL_ResourceFree(CYASSL* ssl)
{
@ -1821,7 +1815,7 @@ static INLINE void Encrypt(CYASSL* ssl, byte* out, const byte* input, word32 sz)
#ifdef BUILD_AES
case aes:
#ifdef CYASSL_AESNI
#ifdef CYASSL_AESNI
if ((word)input % 16) {
byte buffer[MAX_RECORD_SIZE + MAX_COMP_EXTRA+MAX_MSG_EXTRA];
XMEMCPY(buffer, input, sz);
@ -1829,12 +1823,12 @@ static INLINE void Encrypt(CYASSL* ssl, byte* out, const byte* input, word32 sz)
XMEMCPY(out, buffer, sz);
break;
}
#endif
#endif
AesCbcEncrypt(&ssl->encrypt.aes, out, input, sz);
break;
#endif
#if HAVE_HC128
#ifdef HAVE_HC128
case hc128:
Hc128_Process(&ssl->encrypt.hc128, out, input, sz);
break;
@ -1874,7 +1868,7 @@ static INLINE void Decrypt(CYASSL* ssl, byte* plain, const byte* input,
break;
#endif
#if HAVE_HC128
#ifdef HAVE_HC128
case hc128:
Hc128_Process(&ssl->decrypt.hc128, plain, input, sz);
break;
@ -4539,7 +4533,7 @@ int SetCipherList(CYASSL_CTX* ctx, const char* list)
#ifdef HAVE_ECC
byte SetCurveId(int size)
static byte SetCurveId(int size)
{
switch(size) {
case 20:
@ -4747,16 +4741,16 @@ int SetCipherList(CYASSL_CTX* ctx, const char* list)
byte encodedSig[MAX_ENCODED_SIG_SZ];
if (IsAtLeastTLSv1_2(ssl)) {
byte* digest;
int hashType;
int hType;
int digestSz;
/* sha1 for now */
digest = &hash[MD5_DIGEST_SIZE];
hashType = SHAh;
hType = SHAh;
digestSz = SHA_DIGEST_SIZE;
signSz = EncodeSignature(encodedSig, digest, digestSz,
hashType);
hType);
signBuffer = encodedSig;
}
ret = RsaSSL_Sign(signBuffer, signSz, output + idx, sigSz,
@ -5563,13 +5557,13 @@ int SetCipherList(CYASSL_CTX* ctx, const char* list)
#ifdef HAVE_ECC
} else if (ssl->specs.kea == ecc_diffie_hellman_kea) {
word32 size;
word32 length = input[*inOutIdx]; /* one byte length */
word32 bLength = input[*inOutIdx]; /* one byte length */
*inOutIdx += 1;
ret = ecc_import_x963(&input[*inOutIdx], length, &ssl->peerEccKey);
ret = ecc_import_x963(&input[*inOutIdx], bLength, &ssl->peerEccKey);
if (ret != 0)
return ECC_PEERKEY_ERROR;
*inOutIdx += length;
*inOutIdx += bLength;
ssl->peerEccKeyPresent = 1;
size = sizeof(ssl->arrays.preMasterSecret);

View File

@ -565,7 +565,7 @@ static int SetKeys(Ciphers* enc, Ciphers* dec, Keys* keys, CipherSpecs* specs,
}
#endif
#if HAVE_HC128
#ifdef HAVE_HC128
if (specs->bulk_cipher_algorithm == hc128) {
if (side == CLIENT_END) {
Hc128_SetKey(&enc->hc128, keys->client_write_key,

View File

@ -3286,7 +3286,7 @@ int CyaSSL_set_compression(CYASSL* ssl)
}
void CYASSL_SESSION_free(CYASSL_SESSION* session)
void CyaSSL_SESSION_free(CYASSL_SESSION* session)
{
(void)session;
}