summaryrefslogtreecommitdiffstats
path: root/src/plugins/tlsopenssl/tls_openssl.c
diff options
context:
space:
mode:
authorPing Yu <ping.yu@intel.com>2019-01-07 16:03:07 -0500
committerFlorin Coras <florin.coras@gmail.com>2019-01-07 21:21:25 +0000
commitceebc1e71598349ee37b25cd82fe7533760d670a (patch)
treee3c32cfcfcbfda1ee923043360ad7dc727a5c162 /src/plugins/tlsopenssl/tls_openssl.c
parent3a63fc5470caffda434064a439ffdbe8518963f9 (diff)
Change vpp code to align with openssl interface change
PR in openssl community is almost done, and need to change some code in VPP to align with the openssl interface. Change-Id: Ic7da53e507b67b53958760d07738dd774b1c526d Signed-off-by: Ping Yu <ping.yu@intel.com>
Diffstat (limited to 'src/plugins/tlsopenssl/tls_openssl.c')
-rw-r--r--src/plugins/tlsopenssl/tls_openssl.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/src/plugins/tlsopenssl/tls_openssl.c b/src/plugins/tlsopenssl/tls_openssl.c
index 7994cc5d981..d07e0f89838 100644
--- a/src/plugins/tlsopenssl/tls_openssl.c
+++ b/src/plugins/tlsopenssl/tls_openssl.c
@@ -185,8 +185,7 @@ vpp_ssl_async_process_event (tls_ctx_t * ctx,
engine_cb = vpp_add_async_pending_event (ctx, handler);
if (engine_cb)
{
- SSL_set_async_callback (oc->ssl, (void *) engine_cb->callback,
- (void *) engine_cb->arg);
+ SSL_set_async_callback_arg (oc->ssl, (void *) engine_cb->arg);
TLS_DBG (2, "set callback to engine %p\n", engine_cb->callback);
}
return 0;
@@ -201,7 +200,7 @@ vpp_ssl_async_retry_func (tls_ctx_t * ctx, openssl_resume_handler * handler)
if (vpp_add_async_run_event (ctx, handler))
{
- SSL_set_async_estatus (oc->ssl, 0);
+ SSL_clear_async_status (oc->ssl);
}
return 0;
@@ -230,19 +229,23 @@ openssl_ctx_handshake_rx (tls_ctx_t * ctx, stream_session_t * tls_session)
break;
}
+#ifdef HAVE_OPENSSL_ASYNC
+ myself = openssl_ctx_handshake_rx;
+ vpp_ssl_async_process_event (ctx, myself);
+#endif
+
rv = SSL_do_handshake (oc->ssl);
err = SSL_get_error (oc->ssl, rv);
openssl_try_handshake_write (oc, tls_session);
#ifdef HAVE_OPENSSL_ASYNC
- myself = openssl_ctx_handshake_rx;
- if (SSL_get_async_estatus (oc->ssl, &estatus)
- && (estatus == ENGINE_STATUS_RETRY))
- {
- vpp_ssl_async_retry_func (ctx, myself);
- }
- else if (err == SSL_ERROR_WANT_ASYNC)
+ if (err == SSL_ERROR_WANT_ASYNC)
{
- vpp_ssl_async_process_event (ctx, myself);
+ SSL_get_async_status (oc->ssl, &estatus);
+
+ if (estatus == ASYNC_STATUS_EAGAIN)
+ {
+ vpp_ssl_async_retry_func (ctx, myself);
+ }
}
#endif
@@ -587,6 +590,7 @@ openssl_start_listen (tls_ctx_t * lctx)
#ifdef HAVE_OPENSSL_ASYNC
if (om->async)
SSL_CTX_set_mode (ssl_ctx, SSL_MODE_ASYNC);
+ SSL_CTX_set_async_callback (ssl_ctx, tls_async_openssl_callback);
#endif
SSL_CTX_set_options (ssl_ctx, flags);
SSL_CTX_set_ecdh_auto (ssl_ctx, 1);