diff options
author | 2017-01-21 04:16:49 +0000 | |
---|---|---|
committer | 2017-01-21 04:16:49 +0000 | |
commit | 52111e91e7539590591e55b3bd18ca01248a22e1 (patch) | |
tree | 116072bc9a3b06ddcfad6654b0c39003d3c5aa4a /lib/libssl/ssl_lib.c | |
parent | Pull in declarations for main() and __init() to make clang happy. (diff) | |
download | wireguard-openbsd-52111e91e7539590591e55b3bd18ca01248a22e1.tar.xz wireguard-openbsd-52111e91e7539590591e55b3bd18ca01248a22e1.zip |
Expand IMPLEMENT_OBJ_BSEARCH_GLOBAL_CMP_FN macro.
No change in generated assembly.
Diffstat (limited to 'lib/libssl/ssl_lib.c')
-rw-r--r-- | lib/libssl/ssl_lib.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/lib/libssl/ssl_lib.c b/lib/libssl/ssl_lib.c index a4ca1afb1da..7eb192eb2cd 100644 --- a/lib/libssl/ssl_lib.c +++ b/lib/libssl/ssl_lib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssl_lib.c,v 1.124 2017/01/03 16:57:15 jsing Exp $ */ +/* $OpenBSD: ssl_lib.c,v 1.125 2017/01/21 04:16:49 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -3093,4 +3093,18 @@ SSL_cache_hit(SSL *s) return (s->hit); } -IMPLEMENT_OBJ_BSEARCH_GLOBAL_CMP_FN(SSL_CIPHER, SSL_CIPHER, ssl_cipher_id); + +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); +} |