From: discomfitor Date: Wed, 22 Sep 2010 17:37:25 +0000 (+0000) Subject: clean up openssl handshake X-Git-Tag: build/2012-07-04.173327~1742 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=312dbb8bd3d1773d949c069eb1c672d8143441f4;p=profile%2Fivi%2Fecore.git clean up openssl handshake git-svn-id: http://svn.enlightenment.org/svn/e/trunk/ecore@52597 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- diff --git a/src/lib/ecore_con/ecore_con_ssl.c b/src/lib/ecore_con/ecore_con_ssl.c index 1b87158..3eb975e 100644 --- a/src/lib/ecore_con/ecore_con_ssl.c +++ b/src/lib/ecore_con/ecore_con_ssl.c @@ -9,6 +9,7 @@ #elif USE_OPENSSL # include # include +# include #endif #ifdef HAVE_WS2TCPIP_H @@ -168,6 +169,13 @@ ecore_con_ssl_available_get(void) return _ECORE_CON_SSL_AVAILABLE; } +#if 0 +EAPI Eina_Bool +ecore_con_ssl_server_reinit() +{ + +} +#endif Ecore_Con_Ssl_Error ecore_con_ssl_server_prepare(Ecore_Con_Server *svr, int ssl_type) @@ -824,6 +832,13 @@ _ecore_con_ssl_server_prepare_openssl(Ecore_Con_Server *svr, int ssl_type) private_key->count++; } +#if 0 + if (svr->created) + { + SSL_ERROR_CHECK_GOTO_ERROR(!DH_generate_parameters_ex(svr->dh_params, 1024, DH_GENERATOR_5, NULL)); + + } +#endif return ECORE_CON_SSL_ERROR_NONE; error: @@ -844,11 +859,13 @@ _ecore_con_ssl_server_init_openssl(Ecore_Con_Server *svr) SSL_ERROR_CHECK_GOTO_ERROR(!SSL_set_fd(svr->ssl, svr->fd)); SSL_set_connect_state(svr->ssl); - while ((ret = SSL_do_handshake(svr->ssl)) < 1) + do { - int err = SSL_get_error(svr->ssl, ret); + int err; + ret = SSL_do_handshake(svr->ssl); + err = SSL_get_error(svr->ssl, ret); SSL_ERROR_CHECK_GOTO_ERROR((err == SSL_ERROR_SYSCALL) || (err == SSL_ERROR_SSL)); - } + } while (ret < 1); return ECORE_CON_SSL_ERROR_NONE; @@ -1036,11 +1053,14 @@ _ecore_con_ssl_client_init_openssl(Ecore_Con_Client *cl) SSL_ERROR_CHECK_GOTO_ERROR(!SSL_set_fd(cl->ssl, cl->fd)); SSL_set_accept_state(cl->ssl); - while ((ret = SSL_do_handshake(cl->ssl)) < 1) + + do { - int err = SSL_get_error(cl->ssl, ret); + int err; + ret = SSL_do_handshake(cl->ssl); + err = SSL_get_error(cl->ssl, ret); SSL_ERROR_CHECK_GOTO_ERROR((err == SSL_ERROR_SYSCALL) || (err == SSL_ERROR_SSL)); - } + } while (ret < 1); return ECORE_CON_SSL_ERROR_NONE;