From 2f9d73d8f6c3a1a813e54d4cc4f81c7dfca2bee1 Mon Sep 17 00:00:00 2001 From: jsing Date: Sun, 24 Jul 2022 15:05:16 +0000 Subject: [PATCH] Move cipher_id bsearch functions back to the bottom of the file. --- lib/libssl/ssl_lib.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/lib/libssl/ssl_lib.c b/lib/libssl/ssl_lib.c index 02b49670768..e346e3cf7f1 100644 --- a/lib/libssl/ssl_lib.c +++ b/lib/libssl/ssl_lib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssl_lib.c,v 1.299 2022/07/20 14:13:13 tb Exp $ */ +/* $OpenBSD: ssl_lib.c,v 1.300 2022/07/24 15:05:16 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -3298,21 +3298,6 @@ SSL_set_security_level(SSL *ssl, int level) ssl->cert->security_level = level; } -static int -ssl_cipher_id_cmp_BSEARCH_CMP_FN(const void *a_, const void *b_) -{ - SSL_CIPHER const *a = a_; - SSL_CIPHER const *b = b_; - return ssl_cipher_id_cmp(a, b); -} - -SSL_CIPHER * -OBJ_bsearch_ssl_cipher_id(SSL_CIPHER *key, SSL_CIPHER const *base, int num) -{ - return (SSL_CIPHER *)OBJ_bsearch_(key, base, num, sizeof(SSL_CIPHER), - ssl_cipher_id_cmp_BSEARCH_CMP_FN); -} - int SSL_is_quic(const SSL *ssl) { @@ -3344,3 +3329,18 @@ SSL_get_peer_quic_transport_params(const SSL *ssl, const uint8_t **out_params, *out_params = ssl->s3->peer_quic_transport_params; *out_params_len = ssl->s3->peer_quic_transport_params_len; } + +static int +ssl_cipher_id_cmp_BSEARCH_CMP_FN(const void *a_, const void *b_) +{ + SSL_CIPHER const *a = a_; + SSL_CIPHER const *b = b_; + return ssl_cipher_id_cmp(a, b); +} + +SSL_CIPHER * +OBJ_bsearch_ssl_cipher_id(SSL_CIPHER *key, SSL_CIPHER const *base, int num) +{ + return (SSL_CIPHER *)OBJ_bsearch_(key, base, num, sizeof(SSL_CIPHER), + ssl_cipher_id_cmp_BSEARCH_CMP_FN); +} -- 2.20.1