summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAzat Khuzhin <azat@libevent.org>2023-05-14 16:45:14 +0200
committerAzat Khuzhin <azat@libevent.org>2023-05-14 16:49:18 +0200
commit6375dcb46db4bb05c9c19c980f3ed6d0ff9b1065 (patch)
tree8cecc80335d5105ad378079d86f818cb71300f02
parentd06e573c600c46d1c4585be78f4329b300fb4a65 (diff)
downloadlibevent-6375dcb46db4bb05c9c19c980f3ed6d0ff9b1065.tar.gz
ssl: rename err_is_ok to handshake_is_ok (internal API)
-rw-r--r--bufferevent_mbedtls.c5
-rw-r--r--bufferevent_openssl.c5
-rw-r--r--bufferevent_ssl.c2
-rw-r--r--ssl-compat.h2
4 files changed, 8 insertions, 6 deletions
diff --git a/bufferevent_mbedtls.c b/bufferevent_mbedtls.c
index 95859bd3..b0e960fa 100644
--- a/bufferevent_mbedtls.c
+++ b/bufferevent_mbedtls.c
@@ -121,8 +121,9 @@ mbedtls_set_ssl_noops(void *ssl)
{
}
static int
-mbedtls_is_ok(int err)
+mbedtls_handshake_is_ok(int err)
{
+ /* What mbedtls_ssl_handshake() return on success */
return err == 0;
}
static int
@@ -320,7 +321,7 @@ static struct le_ssl_ops le_mbedtls_ops = {
mbedtls_clear,
mbedtls_set_ssl_noops,
mbedtls_set_ssl_noops,
- mbedtls_is_ok,
+ mbedtls_handshake_is_ok,
mbedtls_is_want_read,
mbedtls_is_want_write,
be_mbedtls_get_fd,
diff --git a/bufferevent_openssl.c b/bufferevent_openssl.c
index c74a76e4..f5d0808c 100644
--- a/bufferevent_openssl.c
+++ b/bufferevent_openssl.c
@@ -339,8 +339,9 @@ SSL_context_free(void *ssl, int flags)
}
static int
-SSL_is_ok(int err)
+SSL_handshake_is_ok(int err)
{
+ /* What SSL_do_handshake() return on success */
return err == 1;
}
@@ -413,7 +414,7 @@ static struct le_ssl_ops le_openssl_ops = {
(int (*)(void *))SSL_clear,
(void (*)(void *))SSL_set_connect_state,
(void (*)(void *))SSL_set_accept_state,
- SSL_is_ok,
+ SSL_handshake_is_ok,
SSL_is_want_read,
SSL_is_want_write,
(int (*)(void *))be_openssl_get_fd,
diff --git a/bufferevent_ssl.c b/bufferevent_ssl.c
index 64c36ae6..847c8b67 100644
--- a/bufferevent_ssl.c
+++ b/bufferevent_ssl.c
@@ -706,7 +706,7 @@ do_handshake(struct bufferevent_ssl *bev_ssl)
}
bev_ssl->ssl_ops->decrement_buckets(bev_ssl);
- if (bev_ssl->ssl_ops->err_is_ok(r)) {
+ if (bev_ssl->ssl_ops->handshake_is_ok(r)) {
evutil_socket_t fd = event_get_fd(&bev_ssl->bev.bev.ev_read);
/* We're done! */
bev_ssl->state = BUFFEREVENT_SSL_OPEN;
diff --git a/ssl-compat.h b/ssl-compat.h
index 4dccb52a..a556f4c0 100644
--- a/ssl-compat.h
+++ b/ssl-compat.h
@@ -20,7 +20,7 @@ struct le_ssl_ops {
int (*clear)(void *ssl);
void (*set_connect_state)(void *ssl);
void (*set_accept_state)(void *ssl);
- int (*err_is_ok)(int err);
+ int (*handshake_is_ok)(int err);
int (*err_is_want_read)(int err);
int (*err_is_want_write)(int err);
evutil_socket_t (*get_fd)(void *ssl);