Fixes for CID 185033 185028 185142 185064 185068 185079 185147

This commit is contained in:
Eric Blankenhorn
2018-04-06 13:15:16 -05:00
parent d2c1a1906d
commit 86767e727c
5 changed files with 17 additions and 10 deletions

View File

@@ -134,7 +134,7 @@ static int wolfSSL_BIO_SSL_read(WOLFSSL_BIO* bio, void* buf,
WOLFSSL_ENTER("wolfSSL_BIO_SSL_write");
/* already got eof, again is error */
if (bio && front->eof)
if (front->eof)
return WOLFSSL_FATAL_ERROR;
ret = wolfSSL_read(bio->ssl, buf, len);

View File

@@ -247,6 +247,8 @@ static int CheckCertCRLList(WOLFSSL_CRL* crl, DecodedCert* cert, int *pFoundEntr
ca = GetCA(crl->cm, issuerHash);
#endif /* NO_SKID */
if (ca == NULL) {
XFREE(sig, crl->heap, DYNAMIC_TYPE_CRL_ENTRY);
XFREE(tbs, crl->heap, DYNAMIC_TYPE_CRL_ENTRY);
WOLFSSL_MSG("Did NOT find CRL issuer CA");
return ASN_CRL_NO_SIGNER_E;
}

View File

@@ -11744,10 +11744,10 @@ static INLINE void RmdRounds(int rounds, const byte* data, int sz)
RipeMd ripemd;
int i;
wc_InitRipeMd(&ripemd);
(void)wc_InitRipeMd(&ripemd);
for (i = 0; i < rounds; i++)
wc_RipeMdUpdate(&ripemd, data, sz);
(void)wc_RipeMdUpdate(&ripemd, data, sz);
}
#endif
@@ -14681,11 +14681,13 @@ int SendAlert(WOLFSSL* ssl, int severity, int type)
if ((ret = CheckAvailableSize(ssl, outputSz)) != 0)
return ret;
/* Check output buffer */
if (ssl->buffers.outputBuffer.buffer == NULL)
return BUFFER_E;
/* get output buffer */
output = ssl->buffers.outputBuffer.buffer +
ssl->buffers.outputBuffer.length;
if (output == NULL)
return BUFFER_E;
input[0] = (byte)severity;
input[1] = (byte)type;
@@ -18380,7 +18382,7 @@ static int DoServerKeyExchange(WOLFSSL* ssl, const byte* input,
#endif
if (ssl->peerEccKey == NULL) {
AllocKey(ssl, DYNAMIC_TYPE_ECC,
ret = AllocKey(ssl, DYNAMIC_TYPE_ECC,
(void**)&ssl->peerEccKey);
if (ret != 0) {
goto exit_dske;

View File

@@ -651,9 +651,10 @@ OcspResponse* wolfSSL_d2i_OCSP_RESPONSE_bio(WOLFSSL_BIO* bio,
l = XFTELL(bio->file);
if (l < 0)
return NULL;
XFSEEK(bio->file, i, SEEK_SET);
if (XFSEEK(bio->file, i, SEEK_SET) != 0)
return NULL;
/* check calulated length */
/* check calculated length */
if (l - i <= 0)
return NULL;

View File

@@ -29186,11 +29186,13 @@ void* wolfSSL_GetDhAgreeCtx(WOLFSSL* ssl)
i = XFTELL(bp->file);
if (i < 0)
return NULL;
XFSEEK(bp->file, 0, SEEK_END);
if (XFSEEK(bp->file, 0, SEEK_END) != 0)
return NULL;
l = XFTELL(bp->file);
if (l < 0)
return NULL;
XFSEEK(bp->file, i, SEEK_SET);
if (XFSEEK(bp->file, i, SEEK_SET) != 0)
return NULL;
#else
WOLFSSL_MSG("Unable to read file with NO_FILESYSTEM defined");
return NULL;