forked from wolfSSL/wolfssl
added an additional failure case log output to InitSSL() for the RNG initialize failing
This commit is contained in:
@ -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,
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user