From: Azat Khuzhin Date: Fri, 30 Apr 2021 07:15:45 +0000 (+0300) Subject: Support disabled renegotiation in mbedTLS X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f02fa339488bf5b44db75e568dd2200e70d363ba;p=libevent Support disabled renegotiation in mbedTLS Patch from: @Kurruk007 Fixes: #1161 --- 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 #include #include @@ -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)