diff options
author | Azat Khuzhin <azat@libevent.org> | 2021-04-30 10:15:45 +0300 |
---|---|---|
committer | Azat Khuzhin <azat@libevent.org> | 2021-04-30 10:16:23 +0300 |
commit | f02fa339488bf5b44db75e568dd2200e70d363ba (patch) | |
tree | dff9105aeebd625850d2fd4a2a06f6ffc77241fa | |
parent | 72138063466067b2b5c27d81e18bca0e3b610591 (diff) | |
download | libevent-f02fa339488bf5b44db75e568dd2200e70d363ba.tar.gz |
Support disabled renegotiation in mbedTLS
Patch from: @Kurruk007
Fixes: #1161
-rw-r--r-- | bufferevent_mbedtls.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/bufferevent_mbedtls.c b/bufferevent_mbedtls.c index e535c86f..f42da2ae 100644 --- a/bufferevent_mbedtls.c +++ b/bufferevent_mbedtls.c @@ -25,6 +25,7 @@ */ #include "mbedtls-compat.h" +#include <mbedtls/config.h> #include <mbedtls/ssl.h> #include <mbedtls/error.h> @@ -63,8 +64,12 @@ mbedtls_context_free(void *ssl, int flags) static int mbedtls_context_renegotiate(void *ssl) { +#ifdef MBEDTLS_SSL_RENEGOTIATION struct mbedtls_context *ctx = ssl; return mbedtls_ssl_renegotiate(ctx->ssl); +#else + return MBEDTLS_ERR_SSL_UNEXPECTED_MESSAGE; +#endif } static int mbedtls_context_write(void *ssl, const unsigned char *buf, size_t len) |