summaryrefslogtreecommitdiffstats
path: root/ssl
diff options
context:
space:
mode:
authorVadim Fedorenko <vadimjunk@gmail.com>2020-05-04 12:46:04 +0200
committerMatt Caswell <matt@openssl.org>2020-06-08 12:13:53 +0200
commita6d36303e91b79379da2e2ffaa608dba704d3eb8 (patch)
treecbab959207878788434706cb10526f32d59ca0ce /ssl
parenttest: TLS1.3 and new ciphers for kTLS (diff)
downloadopenssl-a6d36303e91b79379da2e2ffaa608dba704d3eb8.tar.xz
openssl-a6d36303e91b79379da2e2ffaa608dba704d3eb8.zip
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)