diff options
author | John Baldwin <jhb@FreeBSD.org> | 2021-01-29 10:34:49 -0800 |
---|---|---|
committer | Tomas Mraz <tomas@openssl.org> | 2021-02-19 18:04:35 +0100 |
commit | f16e52b67c9261bdc7e1284a50502a802921ac6d (patch) | |
tree | 35f315919b8cbdf7c7d9b69617e09e07b979c00e /crypto/bio/bss_conn.c | |
parent | 5e128ed1209335fb72fe50a68640331e354cbea6 (diff) |
Correct the return value of BIO_get_ktls_*().
BIO_get_ktls_send() and BIO_get_ktls_recv() are documented as
returning either 0 or 1. However, they were actually returning the
internal value of the associated BIO flag for the true case instead of
1.
Also trim redundant ternary operators.
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14023)
Diffstat (limited to 'crypto/bio/bss_conn.c')
-rw-r--r-- | crypto/bio/bss_conn.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/crypto/bio/bss_conn.c b/crypto/bio/bss_conn.c index c7bd0a329f..5b0a69486b 100644 --- a/crypto/bio/bss_conn.c +++ b/crypto/bio/bss_conn.c @@ -536,7 +536,7 @@ static long conn_ctrl(BIO *b, int cmd, long num, void *ptr) } break; case BIO_CTRL_EOF: - ret = (b->flags & BIO_FLAGS_IN_EOF) != 0 ? 1 : 0; + ret = (b->flags & BIO_FLAGS_IN_EOF) != 0; break; # ifndef OPENSSL_NO_KTLS case BIO_CTRL_SET_KTLS: @@ -546,9 +546,9 @@ static long conn_ctrl(BIO *b, int cmd, long num, void *ptr) BIO_set_ktls_flag(b, num); break; case BIO_CTRL_GET_KTLS_SEND: - return BIO_should_ktls_flag(b, 1); + return BIO_should_ktls_flag(b, 1) != 0; case BIO_CTRL_GET_KTLS_RECV: - return BIO_should_ktls_flag(b, 0); + return BIO_should_ktls_flag(b, 0) != 0; case BIO_CTRL_SET_KTLS_TX_SEND_CTRL_MSG: BIO_set_ktls_ctrl_msg_flag(b); data->record_type = num; |