cleanup build warnings

1. Change `CyaSSL_OCSP_set_options()` to return `SSL_SUCCESS`
   or `SSL_FAILURE` as `int` like rest of API.
2. Fix data narrowing warning in file io.c function
   `process_http_response()`.
3. Fix global variable shadowed warning in file ssl.c function
   `CyaSSL_GetSessionAtIndex()`
4. Fix data narrowing warning in file internal.c functions
   `Encrypt()` and `Decrypt()`. Passed in a word32 size parameter
   that was provided a word16 and used as a word16.
5. Removed unreachable code from file tls.c function
   `CyaSSL_GetHmacType()`.
6. Fix data narrowing warnings in file aes.c functions
   `AesCcmEncrypt()` and `AesCcmDecrypt()`.
This commit is contained in:
John Safranek
2013-08-23 10:09:35 -07:00
parent 64ba0587a3
commit d734c86c72
6 changed files with 28 additions and 22 deletions

View File

@@ -4797,14 +4797,14 @@ int CyaSSL_GetSessionIndex(CYASSL* ssl)
}
int CyaSSL_GetSessionAtIndex(int index, CYASSL_SESSION* session)
int CyaSSL_GetSessionAtIndex(int idx, CYASSL_SESSION* session)
{
int row, col, result = SSL_FAILURE;
CYASSL_ENTER("CyaSSL_GetSessionAtIndex");
row = index >> SESSIDX_ROW_SHIFT;
col = index & SESSIDX_IDX_MASK;
row = idx >> SESSIDX_ROW_SHIFT;
col = idx & SESSIDX_IDX_MASK;
if (LockMutex(&session_mutex) != 0) {
return BAD_MUTEX_ERROR;
@@ -10353,7 +10353,7 @@ const byte* CyaSSL_get_sessionID(const CYASSL_SESSION* session)
#endif /* SESSION_CERTS */
long CyaSSL_CTX_OCSP_set_options(CYASSL_CTX* ctx, long options)
int CyaSSL_CTX_OCSP_set_options(CYASSL_CTX* ctx, int options)
{
CYASSL_ENTER("CyaSSL_CTX_OCSP_set_options");
#ifdef HAVE_OCSP
@@ -10361,9 +10361,9 @@ long CyaSSL_CTX_OCSP_set_options(CYASSL_CTX* ctx, long options)
ctx->ocsp.enabled = (options & CYASSL_OCSP_ENABLE) != 0;
ctx->ocsp.useOverrideUrl = (options & CYASSL_OCSP_URL_OVERRIDE) != 0;
ctx->ocsp.useNonce = (options & CYASSL_OCSP_NO_NONCE) == 0;
return 1;
return SSL_SUCCESS;
}
return 0;
return SSL_FAILURE;
#else
(void)ctx;
(void)options;