fix crash in ecore_con_ssl when failing to add privkeys/certs with openssl as spotted by Guillaume Friloux

SVN revision: 76193
This commit is contained in:
Mike Blumenkrantz 2012-09-05 12:41:50 +00:00
parent 79045b88db
commit ea858b74cf
2 changed files with 6 additions and 1 deletions

View File

@ -905,3 +905,7 @@
2012-09-04 Jihoon Kim (jihoon)
* Add ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_SIGNIN
2012-09-05 Mike Blumenkrantz
* Fix crash that could occur in ecore_con_ssl with privkeys and certificates on failure

View File

@ -1741,6 +1741,7 @@ _ecore_con_ssl_server_privkey_add_openssl(Ecore_Con_Server *svr,
SSL_ERROR_CHECK_GOTO_ERROR(!(privkey = PEM_read_PrivateKey(fp, NULL, NULL, NULL)));
fclose(fp);
fp = NULL;
SSL_ERROR_CHECK_GOTO_ERROR(SSL_CTX_use_PrivateKey(svr->ssl_ctx, privkey) < 1);
SSL_ERROR_CHECK_GOTO_ERROR(SSL_CTX_check_private_key(svr->ssl_ctx) < 1);
@ -1766,7 +1767,7 @@ _ecore_con_ssl_server_cert_add_openssl(Ecore_Con_Server *svr,
SSL_ERROR_CHECK_GOTO_ERROR(!(cert = PEM_read_X509(fp, NULL, NULL, NULL)));
fclose(fp);
fp = NULL;
SSL_ERROR_CHECK_GOTO_ERROR(SSL_CTX_use_certificate(svr->ssl_ctx, cert) < 1);
return EINA_TRUE;