diff --git a/ctaocrypt/include/ctc_config.h b/ctaocrypt/include/ctc_config.h index 5e2a270c1..059e1fddd 100644 --- a/ctaocrypt/include/ctc_config.h +++ b/ctaocrypt/include/ctc_config.h @@ -42,7 +42,7 @@ /* Define to 1 or 0, depending whether the compiler supports simple visibility declarations. */ -#define HAVE_VISIBILITY 1 +#define HAVE_VISIBILITY 0 /* Define to the sub-directory in which libtool stores uninstalled libraries. */ diff --git a/ctaocrypt/src/logging.c b/ctaocrypt/src/logging.c index 3ceb3bccc..b29d4cbfa 100644 --- a/ctaocrypt/src/logging.c +++ b/ctaocrypt/src/logging.c @@ -29,13 +29,18 @@ CYASSL_API int CyaSSL_Debugging_ON(void); CYASSL_API void CyaSSL_Debugging_OFF(void); +#ifdef DEBUG_CYASSL + /* Set these to default values initially. */ static CyaSSL_Logging_cb log_function = 0; static int loggingEnabled = 0; +#endif /* DEBUG_CYASSL */ + int CyaSSL_SetLoggingCb(CyaSSL_Logging_cb f) { +#ifdef DEBUG_CYASSL int res = 0; if (f) @@ -44,6 +49,10 @@ int CyaSSL_SetLoggingCb(CyaSSL_Logging_cb f) res = BAD_FUNC_ARG; return res; +#else + (void)f; + return NOT_COMPILED_IN; +#endif } @@ -60,7 +69,9 @@ int CyaSSL_Debugging_ON(void) void CyaSSL_Debugging_OFF(void) { +#ifdef DEBUG_CYASSL loggingEnabled = 0; +#endif } diff --git a/include/openssl/ssl.h b/include/openssl/ssl.h index 07476c3bf..517d3cf4b 100644 --- a/include/openssl/ssl.h +++ b/include/openssl/ssl.h @@ -656,7 +656,7 @@ CYASSL_API int CyaSSL_SetTmpDH(SSL*, unsigned char* p, int pSz, #ifndef _WIN32 #ifndef NO_WRITEV - #if __PPU + #ifdef __PPU #include #include #else diff --git a/src/cyassl_int.c b/src/cyassl_int.c index 20c520b9e..fbc6bc87e 100644 --- a/src/cyassl_int.c +++ b/src/cyassl_int.c @@ -1410,7 +1410,8 @@ static void BuildFinished(SSL* ssl, Hashes* hashes, const byte* sender) Md5 md5 = ssl->hashMd5; Sha sha = ssl->hashSha; #ifndef NO_SHA256 - Sha256 sha256 = {0}; + Sha256 sha256; + InitSha256(&sha256); if (IsAtLeastTLSv1_2(ssl)) sha256 = ssl->hashSha256; #endif @@ -2481,7 +2482,8 @@ static void BuildCertHashes(SSL* ssl, Hashes* hashes) Md5 md5 = ssl->hashMd5; Sha sha = ssl->hashSha; #ifndef NO_SHA256 /* for possible future changes */ - Sha256 sha256 = {0}; + Sha256 sha256; + InitSha256(&sha256); if (IsAtLeastTLSv1_2(ssl)) sha256 = ssl->hashSha256; #endif diff --git a/src/cyassl_io.c b/src/cyassl_io.c index c09314a1f..be8d0cb50 100644 --- a/src/cyassl_io.c +++ b/src/cyassl_io.c @@ -53,7 +53,7 @@ #include #include #include - #if __PPU + #ifdef __PPU #include #else #include @@ -79,7 +79,7 @@ #define SOCKET_ECONNRESET WSAECONNRESET #define SOCKET_EINTR WSAEINTR #define SOCKET_EPIPE WSAEPIPE -#elif __PPU +#elif defined(__PPU) #define SOCKET_EWOULDBLOCK SYS_NET_EWOULDBLOCK #define SOCKET_EAGAIN SYS_NET_EAGAIN #define SOCKET_ECONNRESET SYS_NET_ECONNRESET diff --git a/src/ssl.c b/src/ssl.c index c7ccb044e..24c625651 100644 --- a/src/ssl.c +++ b/src/ssl.c @@ -3261,6 +3261,8 @@ int CyaSSL_set_compression(SSL* ssl) return "TLSv1.1"; case TLSv1_2_MINOR : return "TLSv1.2"; + default: + return "unknown"; } } else if (ssl->version.major == DTLS_MAJOR) @@ -3280,6 +3282,7 @@ int CyaSSL_set_compression(SSL* ssl) { CYASSL_ENTER("SSL_CIPHER_get_name"); if (cipher) { +#ifdef HAVE_ECC if (cipher->ssl->options.cipherSuite0 == ECC_BYTE) { /* ECC suites */ switch (cipher->ssl->options.cipherSuite) { @@ -3299,8 +3302,11 @@ int CyaSSL_set_compression(SSL* ssl) return "TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA"; case TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA : return "TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA"; + default: + return "NONE"; } - } else { +#endif + if (cipher->ssl->options.cipherSuite0 != ECC_BYTE) { /* normal suites */ switch (cipher->ssl->options.cipherSuite) { case SSL_RSA_WITH_RC4_128_SHA : @@ -3343,7 +3349,9 @@ int CyaSSL_set_compression(SSL* ssl) return "TLS_NTRU_RSA_WITH_AES_128_CBC_SHA"; case TLS_NTRU_RSA_WITH_AES_256_CBC_SHA : return "TLS_NTRU_RSA_WITH_AES_256_CBC_SHA"; - } + default: + return "NONE"; + } /* switch */ } /* normal / ECC */ }