From 8f243ab6c173096943ca079648d240eba1e46dd3 Mon Sep 17 00:00:00 2001 From: Thijs Alkemade Date: Wed, 2 Jul 2014 03:32:19 +0100 Subject: [PATCH] Make disabling last cipher work. (cherry picked from commit 7cb472bd0d0fd9da3d42bed1acc56c3a79fc5328) --- ssl/ssl_ciph.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/ssl/ssl_ciph.c b/ssl/ssl_ciph.c index 05b1e5e0db..9c7fbc3022 100644 --- a/ssl/ssl_ciph.c +++ b/ssl/ssl_ciph.c @@ -932,7 +932,7 @@ static void ssl_cipher_apply_rule(unsigned long cipher_id, int rule, int strength_bits, CIPHER_ORDER **head_p, CIPHER_ORDER **tail_p) { - CIPHER_ORDER *head, *tail, *curr, *curr2, *last; + CIPHER_ORDER *head, *tail, *curr, *next, *last; const SSL_CIPHER *cp; int reverse = 0; @@ -949,21 +949,25 @@ static void ssl_cipher_apply_rule(unsigned long cipher_id, if (reverse) { - curr = tail; + next = tail; last = head; } else { - curr = head; + next = head; last = tail; } - curr2 = curr; + curr = NULL; for (;;) { - if ((curr == NULL) || (curr == last)) break; - curr = curr2; - curr2 = reverse ? curr->prev : curr->next; + if (curr == last) break; + + curr = next; + + if (curr == NULL) break; + + next = reverse ? curr->prev : curr->next; cp = curr->cipher; -- 2.40.0