summaryrefslogtreecommitdiff
path: root/src/lib/libssl/ssl_ciph.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libssl/ssl_ciph.c')
-rw-r--r--src/lib/libssl/ssl_ciph.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/lib/libssl/ssl_ciph.c b/src/lib/libssl/ssl_ciph.c
index bf22c4ed99..0e9941bc0b 100644
--- a/src/lib/libssl/ssl_ciph.c
+++ b/src/lib/libssl/ssl_ciph.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssl_ciph.c,v 1.123 2021/05/16 08:24:21 jsing Exp $ */ 1/* $OpenBSD: ssl_ciph.c,v 1.124 2021/07/03 16:06:44 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -1228,7 +1228,7 @@ ssl_create_cipher_list(const SSL_METHOD *ssl_method,
1228 * in ciphers. We cannot get more than the number compiled in, so 1228 * in ciphers. We cannot get more than the number compiled in, so
1229 * it is used for allocation. 1229 * it is used for allocation.
1230 */ 1230 */
1231 num_of_ciphers = ssl_method->num_ciphers(); 1231 num_of_ciphers = ssl3_num_ciphers();
1232 co_list = reallocarray(NULL, num_of_ciphers, sizeof(CIPHER_ORDER)); 1232 co_list = reallocarray(NULL, num_of_ciphers, sizeof(CIPHER_ORDER));
1233 if (co_list == NULL) { 1233 if (co_list == NULL) {
1234 SSLerrorx(ERR_R_MALLOC_FAILURE); 1234 SSLerrorx(ERR_R_MALLOC_FAILURE);
@@ -1603,7 +1603,15 @@ SSL_CIPHER_get_value(const SSL_CIPHER *c)
1603const SSL_CIPHER * 1603const SSL_CIPHER *
1604SSL_CIPHER_find(SSL *ssl, const unsigned char *ptr) 1604SSL_CIPHER_find(SSL *ssl, const unsigned char *ptr)
1605{ 1605{
1606 return ssl->method->get_cipher_by_char(ptr); 1606 uint16_t cipher_value;
1607 CBS cbs;
1608
1609 /* This API is documented with ptr being an array of length two. */
1610 CBS_init(&cbs, ptr, 2);
1611 if (!CBS_get_u16(&cbs, &cipher_value))
1612 return NULL;
1613
1614 return ssl3_get_cipher_by_value(cipher_value);
1607} 1615}
1608 1616
1609int 1617int