diff options
author | Vladislav Grishenko <themiron@mail.ru> | 2018-10-25 03:38:45 +0500 |
---|---|---|
committer | Vladislav Grishenko <themiron@mail.ru> | 2018-10-25 03:38:45 +0500 |
commit | aa96b94f6726d35c8966bb4ce55636696f8db431 (patch) | |
tree | 607f87e1e1c94d871c9c6c4062e5be65a64d1731 | |
parent | ddec278512b285d0786666208b7c75c86d1b2216 (diff) | |
download | accel-ppp-aa96b94f6726d35c8966bb4ce55636696f8db431.tar.gz accel-ppp-aa96b94f6726d35c8966bb4ce55636696f8db431.zip |
sstp: disable ciphers renegotiation (CVE-2009-3555)
-rw-r--r-- | accel-pppd/ctrl/sstp/sstp.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/accel-pppd/ctrl/sstp/sstp.c b/accel-pppd/ctrl/sstp/sstp.c index 6f660d9d..af6bc77e 100644 --- a/accel-pppd/ctrl/sstp/sstp.c +++ b/accel-pppd/ctrl/sstp/sstp.c @@ -2328,6 +2328,16 @@ static int ssl_servername(SSL *ssl, int *al, void *arg) } #endif +#if !defined(SSL_OP_NO_RENGOTIATION) && defined(SSL3_FLAGS_NO_RENEGOTIATE_CIPHERS) +static void ssl_info_cb(const SSL *ssl, int where, int ret) +{ + if ((where & SSL_CB_HANDSHAKE_DONE) != 0) { + /* disable renegotiation (CVE-2009-3555) */ + ssl->s3->flags |= SSL3_FLAGS_NO_RENEGOTIATE_CIPHERS; + } +} +#endif + static void ssl_load_config(struct sstp_serv_t *serv, const char *servername) { SSL_CTX *old_ctx, *ssl_ctx = NULL; @@ -2372,6 +2382,9 @@ static void ssl_load_config(struct sstp_serv_t *serv, const char *servername) #ifdef SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS | #endif +#ifdef SSL_OP_NO_RENGOTIATION + SSL_OP_NO_RENGOTIATION | +#endif #ifndef OPENSSL_NO_DH SSL_OP_SINGLE_DH_USE | #endif @@ -2473,6 +2486,10 @@ static void ssl_load_config(struct sstp_serv_t *serv, const char *servername) if (servername && SSL_CTX_set_tlsext_servername_callback(ssl_ctx, ssl_servername) != 1) log_warn("sstp: SSL server name check error: %s\n", ERR_error_string(ERR_get_error(), NULL)); #endif + +#if !defined(SSL_OP_NO_RENGOTIATION) && defined(SSL3_FLAGS_NO_RENEGOTIATE_CIPHERS) + SSL_CTX_set_info_callback(ssl_ctx, ssl_info_cb); +#endif } else { /* legacy option, to be removed */ opt = conf_get_opt("sstp", "ssl"); |