diff options
author | jsing <> | 2024-07-23 14:40:54 +0000 |
---|---|---|
committer | jsing <> | 2024-07-23 14:40:54 +0000 |
commit | 6861a5a72a0bd87259b9e40bd0a0f7c85fd11e9c (patch) | |
tree | 5d02fbe166341d303cc7117737100adbfbf744c2 /src/lib/libssl/d1_lib.c | |
parent | 9d00569d89dbe870d2bc630ceb14e42ee1807ec5 (diff) | |
download | openbsd-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/d1_lib.c')
-rw-r--r-- | src/lib/libssl/d1_lib.c | 23 |
1 files changed, 1 insertions, 22 deletions
diff --git a/src/lib/libssl/d1_lib.c b/src/lib/libssl/d1_lib.c index ae6a6650ab..69db8a0df4 100644 --- a/src/lib/libssl/d1_lib.c +++ b/src/lib/libssl/d1_lib.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: d1_lib.c,v 1.64 2022/11/26 16:08:55 tb Exp $ */ | 1 | /* $OpenBSD: d1_lib.c,v 1.65 2024/07/23 14:40:53 jsing Exp $ */ |
2 | /* | 2 | /* |
3 | * DTLS implementation written by Nagendra Modadugu | 3 | * DTLS implementation written by Nagendra Modadugu |
4 | * (nagendra@cs.stanford.edu) for the OpenSSL project 2005. | 4 | * (nagendra@cs.stanford.edu) for the OpenSSL project 2005. |
@@ -250,27 +250,6 @@ dtls1_ctrl(SSL *s, int cmd, long larg, void *parg) | |||
250 | return (ret); | 250 | return (ret); |
251 | } | 251 | } |
252 | 252 | ||
253 | /* | ||
254 | * As it's impossible to use stream ciphers in "datagram" mode, this | ||
255 | * simple filter is designed to disengage them in DTLS. Unfortunately | ||
256 | * there is no universal way to identify stream SSL_CIPHER, so we have | ||
257 | * to explicitly list their SSL_* codes. Currently RC4 is the only one | ||
258 | * available, but if new ones emerge, they will have to be added... | ||
259 | */ | ||
260 | const SSL_CIPHER * | ||
261 | dtls1_get_cipher(unsigned int u) | ||
262 | { | ||
263 | const SSL_CIPHER *cipher; | ||
264 | |||
265 | if ((cipher = ssl3_get_cipher(u)) == NULL) | ||
266 | return NULL; | ||
267 | |||
268 | if (cipher->algorithm_enc == SSL_RC4) | ||
269 | return NULL; | ||
270 | |||
271 | return cipher; | ||
272 | } | ||
273 | |||
274 | void | 253 | void |
275 | dtls1_start_timer(SSL *s) | 254 | dtls1_start_timer(SSL *s) |
276 | { | 255 | { |