aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/tlsopenssl/tls_openssl.c
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2023-10-17 11:59:49 -0700
committerDave Barach <vpp@barachs.net>2024-09-26 20:44:34 +0000
commitd0e8bd75f6371d09f31f48ffaf5843dce86ca8e6 (patch)
tree60afbb7769d3c4abce413d5055387ef031c975d5 /src/plugins/tlsopenssl/tls_openssl.c
parent2193fd06492ee0f9a8c9b89fe665ecbc4d50cefe (diff)
tls: cleanup engine hs cb and improve ctx formatting
Handshake completion is now tracked via a ctx flag so we no longer need ctx_handshake_is_over. Also, as we no longer prealloc application sessions, improve ctx state formatting. Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: If48588ecde13e56fb99d1a46238bda53ed4eae1b
Diffstat (limited to 'src/plugins/tlsopenssl/tls_openssl.c')
-rw-r--r--src/plugins/tlsopenssl/tls_openssl.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/src/plugins/tlsopenssl/tls_openssl.c b/src/plugins/tlsopenssl/tls_openssl.c
index 19aae3ffadc..c8e685f20c5 100644
--- a/src/plugins/tlsopenssl/tls_openssl.c
+++ b/src/plugins/tlsopenssl/tls_openssl.c
@@ -1037,15 +1037,6 @@ openssl_ctx_init_server (tls_ctx_t * ctx)
return 0;
}
-static u8
-openssl_handshake_is_over (tls_ctx_t * ctx)
-{
- openssl_ctx_t *mc = (openssl_ctx_t *) ctx;
- if (!mc->ssl)
- return 0;
- return SSL_is_init_finished (mc->ssl);
-}
-
static int
openssl_transport_close (tls_ctx_t * ctx)
{
@@ -1054,7 +1045,7 @@ openssl_transport_close (tls_ctx_t * ctx)
return 0;
#endif
- if (!openssl_handshake_is_over (ctx))
+ if (!(ctx->flags & TLS_CONN_F_HS_DONE))
{
openssl_handle_handshake_failure (ctx);
return 0;
@@ -1066,7 +1057,7 @@ openssl_transport_close (tls_ctx_t * ctx)
static int
openssl_transport_reset (tls_ctx_t *ctx)
{
- if (!openssl_handshake_is_over (ctx))
+ if (!(ctx->flags & TLS_CONN_F_HS_DONE))
{
openssl_handle_handshake_failure (ctx);
return 0;
@@ -1166,7 +1157,6 @@ const static tls_engine_vft_t openssl_engine = {
.ctx_init_client = openssl_ctx_init_client,
.ctx_write = openssl_ctx_write,
.ctx_read = openssl_ctx_read,
- .ctx_handshake_is_over = openssl_handshake_is_over,
.ctx_start_listen = openssl_start_listen,
.ctx_stop_listen = openssl_stop_listen,
.ctx_transport_close = openssl_transport_close,