summaryrefslogtreecommitdiffstats
path: root/lib/libssl/ssl_ciphers.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libssl/ssl_ciphers.c')
-rw-r--r--lib/libssl/ssl_ciphers.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/lib/libssl/ssl_ciphers.c b/lib/libssl/ssl_ciphers.c
index d13ce7a9c5c..478238bd103 100644
--- a/lib/libssl/ssl_ciphers.c
+++ b/lib/libssl/ssl_ciphers.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssl_ciphers.c,v 1.5 2020/09/11 15:28:07 jsing Exp $ */
+/* $OpenBSD: ssl_ciphers.c,v 1.6 2020/09/11 17:36:27 jsing Exp $ */
/*
* Copyright (c) 2015-2017 Doug Hogan <doug@openbsd.org>
* Copyright (c) 2015-2018 Joel Sing <jsing@openbsd.org>
@@ -23,6 +23,19 @@
#include "ssl_locl.h"
int
+ssl_cipher_in_list(STACK_OF(SSL_CIPHER) *ciphers, const SSL_CIPHER *cipher)
+{
+ int i;
+
+ for (i = 0; i < sk_SSL_CIPHER_num(ciphers); i++) {
+ if (sk_SSL_CIPHER_value(ciphers, i)->id == cipher->id)
+ return 1;
+ }
+
+ return 0;
+}
+
+int
ssl_cipher_allowed_in_version_range(const SSL_CIPHER *cipher, uint16_t min_ver,
uint16_t max_ver)
{