summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortb <>2024-06-25 05:46:48 +0000
committertb <>2024-06-25 05:46:48 +0000
commit16d1647aeb8144aecd31b377e554c6f23fe7912a (patch)
tree92bb41980139df437df74af34cd4f6fc878c1778 /src
parenta867c0bde57f054ddb1070563c7ade884b7c3c7c (diff)
downloadopenbsd-16d1647aeb8144aecd31b377e554c6f23fe7912a.tar.gz
openbsd-16d1647aeb8144aecd31b377e554c6f23fe7912a.tar.bz2
openbsd-16d1647aeb8144aecd31b377e554c6f23fe7912a.zip
Fix TLS extension shuffling
The diff decoupling the shuffle from the table order still relied on PSK being last because it failed to adjust the upper bound in the for loop. ok jsing
Diffstat (limited to 'src')
-rw-r--r--src/lib/libssl/ssl_tlsext.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/libssl/ssl_tlsext.c b/src/lib/libssl/ssl_tlsext.c
index 62bb3d737a..64f82b7dfb 100644
--- a/src/lib/libssl/ssl_tlsext.c
+++ b/src/lib/libssl/ssl_tlsext.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssl_tlsext.c,v 1.150 2024/06/06 16:13:12 tb Exp $ */ 1/* $OpenBSD: ssl_tlsext.c,v 1.151 2024/06/25 05:46:48 tb Exp $ */
2/* 2/*
3 * Copyright (c) 2016, 2017, 2019 Joel Sing <jsing@openbsd.org> 3 * Copyright (c) 2016, 2017, 2019 Joel Sing <jsing@openbsd.org>
4 * Copyright (c) 2017 Doug Hogan <doug@openbsd.org> 4 * Copyright (c) 2017 Doug Hogan <doug@openbsd.org>
@@ -2427,7 +2427,7 @@ tlsext_randomize_build_order(SSL *s)
2427 s->tlsext_build_order[N_TLS_EXTENSIONS - 1] = psk_ext; 2427 s->tlsext_build_order[N_TLS_EXTENSIONS - 1] = psk_ext;
2428 2428
2429 /* Fisher-Yates shuffle with PSK fixed. */ 2429 /* Fisher-Yates shuffle with PSK fixed. */
2430 for (idx = 0; idx < psk_idx; idx++) { 2430 for (idx = 0; idx < N_TLS_EXTENSIONS - 1; idx++) {
2431 new_idx = arc4random_uniform(idx + 1); 2431 new_idx = arc4random_uniform(idx + 1);
2432 s->tlsext_build_order[idx] = s->tlsext_build_order[new_idx]; 2432 s->tlsext_build_order[idx] = s->tlsext_build_order[new_idx];
2433 s->tlsext_build_order[new_idx] = &tls_extensions[idx]; 2433 s->tlsext_build_order[new_idx] = &tls_extensions[idx];