summaryrefslogtreecommitdiffstats
path: root/ssl
diff options
context:
space:
mode:
authorVadim Fedorenko <vadimjunk@gmail.com>2020-05-04 13:46:04 +0300
committerMatt Caswell <matt@openssl.org>2020-06-08 11:13:53 +0100
commita6d36303e91b79379da2e2ffaa608dba704d3eb8 (patch)
treecbab959207878788434706cb10526f32d59ca0ce /ssl
parentda4db1602d8f7f031f12ddc04de84129138c419c (diff)
TLSv1.3: additional checks in SSL_set_record_padding_callback
Reviewed-by: Paul Dale <paul.dale@oracle.com> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/11589)
Diffstat (limited to 'ssl')
-rw-r--r--ssl/ssl_lib.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/ssl/ssl_lib.c b/ssl/ssl_lib.c
index c2c2388716..9fb65b6825 100644
--- a/ssl/ssl_lib.c
+++ b/ssl/ssl_lib.c
@@ -4645,11 +4645,18 @@ int SSL_CTX_set_block_padding(SSL_CTX *ctx, size_t block_size)
return 1;
}
-void SSL_set_record_padding_callback(SSL *ssl,
+int SSL_set_record_padding_callback(SSL *ssl,
size_t (*cb) (SSL *ssl, int type,
size_t len, void *arg))
{
- ssl->record_padding_cb = cb;
+ BIO *b;
+
+ b = SSL_get_wbio(ssl);
+ if (b == NULL || !BIO_get_ktls_send(b)) {
+ ssl->record_padding_cb = cb;
+ return 1;
+ }
+ return 0;
}
void SSL_set_record_padding_callback_arg(SSL *ssl, void *arg)