diff options
author | Hugo Landau <hlandau@openssl.org> | 2022-11-17 15:17:39 +0000 |
---|---|---|
committer | Hugo Landau <hlandau@openssl.org> | 2023-01-13 13:20:14 +0000 |
commit | 68801bcb766806a04e95e8ef714a0b836b1d7069 (patch) | |
tree | 1ea4c0098636cc8241114e25f2761fccac618790 /ssl | |
parent | 4ed9e0a1e36eaa8f07a4a5371f9d13912a3f9da8 (diff) |
Add BIO poll descriptors
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19703)
Diffstat (limited to 'ssl')
-rw-r--r-- | ssl/bio_ssl.c | 8 | ||||
-rw-r--r-- | ssl/ssl_lib.c | 28 |
2 files changed, 36 insertions, 0 deletions
diff --git a/ssl/bio_ssl.c b/ssl/bio_ssl.c index c9bb20b2da..64d1849c7e 100644 --- a/ssl/bio_ssl.c +++ b/ssl/bio_ssl.c @@ -385,6 +385,14 @@ static long ssl_ctrl(BIO *b, int cmd, long num, void *ptr) case BIO_CTRL_SET_CALLBACK: ret = 0; /* use callback ctrl */ break; + case BIO_CTRL_GET_RPOLL_DESCRIPTOR: + if (!SSL_get_rpoll_descriptor(ssl, (BIO_POLL_DESCRIPTOR *)ptr)) + ret = 0; + break; + case BIO_CTRL_GET_WPOLL_DESCRIPTOR: + if (!SSL_get_wpoll_descriptor(ssl, (BIO_POLL_DESCRIPTOR *)ptr)) + ret = 0; + break; default: ret = BIO_ctrl(sc->rbio, cmd, num, ptr); break; diff --git a/ssl/ssl_lib.c b/ssl/ssl_lib.c index 77abe3dc27..9a24893601 100644 --- a/ssl/ssl_lib.c +++ b/ssl/ssl_lib.c @@ -6942,3 +6942,31 @@ int SSL_CTX_set0_tmp_dh_pkey(SSL_CTX *ctx, EVP_PKEY *dhpkey) ctx->cert->dh_tmp = dhpkey; return 1; } + +int SSL_get_rpoll_descriptor(SSL *s, BIO_POLL_DESCRIPTOR *desc) +{ +#ifndef OPENSSL_NO_QUIC + QUIC_CONNECTION *qc = QUIC_CONNECTION_FROM_SSL(s); + + if (qc == NULL) + return -1; + + return -1; /* TODO(QUIC) */ +#else + return -1; +#endif +} + +int SSL_get_wpoll_descriptor(SSL *s, BIO_POLL_DESCRIPTOR *desc) +{ +#ifndef OPENSSL_NO_QUIC + QUIC_CONNECTION *qc = QUIC_CONNECTION_FROM_SSL(s); + + if (qc == NULL) + return -1; + + return -1; /* TODO(QUIC) */ +#else + return -1; +#endif +} |