Latest update
This commit is contained in:
+27
-2
@@ -22,6 +22,7 @@
|
||||
#include <openssl/ct.h>
|
||||
#include "internal/cryptlib.h"
|
||||
#include "internal/refcount.h"
|
||||
#include "internal/ktls.h"
|
||||
|
||||
static int ssl_undefined_function_1(SSL *ssl, SSL3_RECORD *r, size_t s, int t)
|
||||
{
|
||||
@@ -1211,11 +1212,15 @@ void SSL_free(SSL *s)
|
||||
dane_final(&s->dane);
|
||||
CRYPTO_free_ex_data(CRYPTO_EX_INDEX_SSL, s, &s->ex_data);
|
||||
|
||||
RECORD_LAYER_release(&s->rlayer);
|
||||
|
||||
/* Ignore return value */
|
||||
ssl_free_wbio_buffer(s);
|
||||
|
||||
BIO_free_all(s->wbio);
|
||||
s->wbio = NULL;
|
||||
BIO_free_all(s->rbio);
|
||||
s->rbio = NULL;
|
||||
|
||||
BUF_MEM_free(s->init_buf);
|
||||
|
||||
@@ -1267,8 +1272,6 @@ void SSL_free(SSL *s)
|
||||
if (s->method != NULL)
|
||||
s->method->ssl_free(s);
|
||||
|
||||
RECORD_LAYER_release(&s->rlayer);
|
||||
|
||||
SSL_CTX_free(s->ctx);
|
||||
|
||||
ASYNC_WAIT_CTX_free(s->waitctx);
|
||||
@@ -1408,6 +1411,15 @@ int SSL_set_fd(SSL *s, int fd)
|
||||
}
|
||||
BIO_set_fd(bio, fd, BIO_NOCLOSE);
|
||||
SSL_set_bio(s, bio, bio);
|
||||
#ifndef OPENSSL_NO_KTLS
|
||||
/*
|
||||
* The new socket is created successfully regardless of ktls_enable.
|
||||
* ktls_enable doesn't change any functionality of the socket, except
|
||||
* changing the setsockopt to enable the processing of ktls_start.
|
||||
* Thus, it is not a problem to call it for non-TLS sockets.
|
||||
*/
|
||||
ktls_enable(fd);
|
||||
#endif /* OPENSSL_NO_KTLS */
|
||||
ret = 1;
|
||||
err:
|
||||
return ret;
|
||||
@@ -1427,6 +1439,15 @@ int SSL_set_wfd(SSL *s, int fd)
|
||||
}
|
||||
BIO_set_fd(bio, fd, BIO_NOCLOSE);
|
||||
SSL_set0_wbio(s, bio);
|
||||
#ifndef OPENSSL_NO_KTLS
|
||||
/*
|
||||
* The new socket is created successfully regardless of ktls_enable.
|
||||
* ktls_enable doesn't change any functionality of the socket, except
|
||||
* changing the setsockopt to enable the processing of ktls_start.
|
||||
* Thus, it is not a problem to call it for non-TLS sockets.
|
||||
*/
|
||||
ktls_enable(fd);
|
||||
#endif /* OPENSSL_NO_KTLS */
|
||||
} else {
|
||||
BIO_up_ref(rbio);
|
||||
SSL_set0_wbio(s, rbio);
|
||||
@@ -2252,6 +2273,10 @@ long SSL_ctrl(SSL *s, int cmd, long larg, void *parg)
|
||||
case SSL_CTRL_SET_MAX_SEND_FRAGMENT:
|
||||
if (larg < 512 || larg > SSL3_RT_MAX_PLAIN_LENGTH)
|
||||
return 0;
|
||||
#ifndef OPENSSL_NO_KTLS
|
||||
if (s->wbio != NULL && BIO_get_ktls_send(s->wbio))
|
||||
return 0;
|
||||
#endif /* OPENSSL_NO_KTLS */
|
||||
s->max_send_fragment = larg;
|
||||
if (s->max_send_fragment < s->split_send_fragment)
|
||||
s->split_send_fragment = s->max_send_fragment;
|
||||
|
||||
Reference in New Issue
Block a user