summaryrefslogtreecommitdiff
path: root/src/lib/libssl/s3_lib.c
diff options
context:
space:
mode:
authorjsing <>2024-07-23 14:40:54 +0000
committerjsing <>2024-07-23 14:40:54 +0000
commit6861a5a72a0bd87259b9e40bd0a0f7c85fd11e9c (patch)
tree5d02fbe166341d303cc7117737100adbfbf744c2 /src/lib/libssl/s3_lib.c
parent9d00569d89dbe870d2bc630ceb14e42ee1807ec5 (diff)
downloadopenbsd-6861a5a72a0bd87259b9e40bd0a0f7c85fd11e9c.tar.gz
openbsd-6861a5a72a0bd87259b9e40bd0a0f7c85fd11e9c.tar.bz2
openbsd-6861a5a72a0bd87259b9e40bd0a0f7c85fd11e9c.zip
Remove get_cipher from SSL_METHOD.
Inline the get_cipher implementation (including the special handling for DTLS) in ssl_cipher_collect_ciphers() (the only consumer), remove the get_cipher member of SSL_METHOD and mop up dtls1_get_cipher(). ssl3_get_cipher() has always had a strange property of being a reverse index, which is relied on by the cipher list ordering code, since it currently assumes that high cipher suite values are preferable. Rather than complicating ssl3_get_cipher() (and regress), change the iteration order in ssl_cipher_collect_ciphers() to match what it requires. Lastly, rename ssl3_get_cipher() to be more descriptive. ok tb@
Diffstat (limited to 'src/lib/libssl/s3_lib.c')
-rw-r--r--src/lib/libssl/s3_lib.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/lib/libssl/s3_lib.c b/src/lib/libssl/s3_lib.c
index d30eb6deb7..86b32aec15 100644
--- a/src/lib/libssl/s3_lib.c
+++ b/src/lib/libssl/s3_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: s3_lib.c,v 1.256 2024/07/22 14:47:15 jsing Exp $ */ 1/* $OpenBSD: s3_lib.c,v 1.257 2024/07/23 14:40:53 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 *
@@ -1127,12 +1127,12 @@ ssl3_num_ciphers(void)
1127} 1127}
1128 1128
1129const SSL_CIPHER * 1129const SSL_CIPHER *
1130ssl3_get_cipher(unsigned int u) 1130ssl3_get_cipher_by_index(int idx)
1131{ 1131{
1132 if (u < SSL3_NUM_CIPHERS) 1132 if (idx < 0 || idx >= SSL3_NUM_CIPHERS)
1133 return (&(ssl3_ciphers[SSL3_NUM_CIPHERS - 1 - u])); 1133 return NULL;
1134 else 1134
1135 return (NULL); 1135 return &ssl3_ciphers[idx];
1136} 1136}
1137 1137
1138static int 1138static int