From: tb Date: Mon, 10 May 2021 17:03:57 +0000 (+0000) Subject: Provide SSL_CIPHER_find(3) X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=92b883b3285077da45b99d1867312f376db9cddf;p=openbsd Provide SSL_CIPHER_find(3) ok jsing --- diff --git a/lib/libssl/Symbols.list b/lib/libssl/Symbols.list index 15d43f891e1..871af0ca92d 100644 --- a/lib/libssl/Symbols.list +++ b/lib/libssl/Symbols.list @@ -45,6 +45,7 @@ ERR_load_SSL_strings /* general API */ SSL_CIPHER_description +SSL_CIPHER_find SSL_CIPHER_get_auth_nid SSL_CIPHER_get_bits SSL_CIPHER_get_by_id diff --git a/lib/libssl/ssl.h b/lib/libssl/ssl.h index 5ed2198b38f..02f37fb0d0b 100644 --- a/lib/libssl/ssl.h +++ b/lib/libssl/ssl.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ssl.h,v 1.186 2021/03/31 16:59:32 tb Exp $ */ +/* $OpenBSD: ssl.h,v 1.187 2021/05/10 17:03:57 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -1313,6 +1313,7 @@ const char * SSL_CIPHER_get_version(const SSL_CIPHER *c); const char * SSL_CIPHER_get_name(const SSL_CIPHER *c); unsigned long SSL_CIPHER_get_id(const SSL_CIPHER *c); uint16_t SSL_CIPHER_get_value(const SSL_CIPHER *c); +const SSL_CIPHER *SSL_CIPHER_find(SSL *ssl, const unsigned char *ptr); int SSL_CIPHER_get_cipher_nid(const SSL_CIPHER *c); int SSL_CIPHER_get_digest_nid(const SSL_CIPHER *c); int SSL_CIPHER_get_kx_nid(const SSL_CIPHER *c); diff --git a/lib/libssl/ssl_ciph.c b/lib/libssl/ssl_ciph.c index ee627a8c1e9..2db531abb12 100644 --- a/lib/libssl/ssl_ciph.c +++ b/lib/libssl/ssl_ciph.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssl_ciph.c,v 1.121 2021/03/24 18:44:00 jsing Exp $ */ +/* $OpenBSD: ssl_ciph.c,v 1.122 2021/05/10 17:03:57 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -1599,6 +1599,12 @@ SSL_CIPHER_get_value(const SSL_CIPHER *c) return ssl3_cipher_get_value(c); } +const SSL_CIPHER * +SSL_CIPHER_find(SSL *ssl, const unsigned char *ptr) +{ + return ssl->method->get_cipher_by_char(ptr); +} + int SSL_CIPHER_get_cipher_nid(const SSL_CIPHER *c) {