added an additional failure case log output to InitSSL() for the RNG initialize failing

This commit is contained in:
John Safranek
2013-02-22 09:51:07 -08:00
parent 6ff39cffe4
commit 88ba790930
2 changed files with 6 additions and 3 deletions

View File

@ -1340,8 +1340,10 @@ int InitSSL(CYASSL* ssl, CYASSL_CTX* ctx)
return MEMORY_E;
}
if ( (ret = InitRng(ssl->rng)) != 0)
if ( (ret = InitRng(ssl->rng)) != 0) {
CYASSL_MSG("RNG Init error");
return ret;
}
/* suites */
ssl->suites = (Suites*)XMALLOC(sizeof(Suites), ssl->heap,

View File

@ -147,6 +147,7 @@ void CyaSSL_CTX_free(CYASSL_CTX* ctx)
CYASSL* CyaSSL_new(CYASSL_CTX* ctx)
{
CYASSL* ssl = NULL;
int ret = 0;
CYASSL_ENTER("SSL_new");
@ -155,12 +156,12 @@ CYASSL* CyaSSL_new(CYASSL_CTX* ctx)
ssl = (CYASSL*) XMALLOC(sizeof(CYASSL), ctx->heap,DYNAMIC_TYPE_SSL);
if (ssl)
if (InitSSL(ssl, ctx) < 0) {
if ( (ret = InitSSL(ssl, ctx)) < 0) {
FreeSSL(ssl);
ssl = 0;
}
CYASSL_LEAVE("SSL_new", 0);
CYASSL_LEAVE("SSL_new", ret);
return ssl;
}