finally crush the last openssl segv
authordiscomfitor <discomfitor@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Sun, 19 Sep 2010 18:40:43 +0000 (18:40 +0000)
committerdiscomfitor <discomfitor@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Sun, 19 Sep 2010 18:40:43 +0000 (18:40 +0000)
still broken though

git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/ecore@52467 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/ecore_con/ecore_con_ssl.c

index 912bf0a..5d68b3c 100644 (file)
@@ -812,12 +812,8 @@ _ecore_con_ssl_server_init_openssl(Ecore_Con_Server *svr)
    return ECORE_CON_SSL_ERROR_NONE;
 
 error:
-   if (svr->ssl)
-     SSL_free(svr->ssl);
-   if (svr->ssl_ctx)
-     SSL_CTX_free(svr->ssl_ctx);
-
    ERR("openssl error: %s", ERR_reason_error_string(ERR_get_error()));
+   _ecore_con_ssl_server_shutdown_openssl(svr);
    return ECORE_CON_SSL_ERROR_SERVER_INIT_FAILED;
 }
 
@@ -998,15 +994,13 @@ _ecore_con_ssl_client_init_openssl(Ecore_Con_Client *cl)
 
    SSL_set_accept_state(cl->ssl);
    SSL_ERROR_CHECK_GOTO_ERROR(!SSL_set_fd(cl->ssl, cl->fd));
-   SSL_ERROR_CHECK_GOTO_ERROR(SSL_do_handshake(cl->ssl) < 1);
+   SSL_ERROR_CHECK_GOTO_ERROR(SSL_accept(cl->ssl) < 1);
    
    return ECORE_CON_SSL_ERROR_NONE;
 
 error:
-   if (cl->ssl)
-     SSL_free(cl->ssl);
-
    ERR("openssl error: %s", ERR_reason_error_string(ERR_get_error()));
+   _ecore_con_ssl_client_shutdown_openssl(cl);
    return ECORE_CON_SSL_ERROR_SERVER_INIT_FAILED;
 }