Make disabling last cipher work.
authorThijs Alkemade <me@thijsalkema.de>
Wed, 2 Jul 2014 02:32:19 +0000 (03:32 +0100)
committerDr. Stephen Henson <steve@openssl.org>
Wed, 2 Jul 2014 02:33:12 +0000 (03:33 +0100)
(cherry picked from commit 7cb472bd0d0fd9da3d42bed1acc56c3a79fc5328)

ssl/ssl_ciph.c

index 704854be911341288e1041650e43612bc0e83cee..6fc6ad205f3c26da3cbd2cb18f7cb54ac2c5e4da 100644 (file)
@@ -848,7 +848,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;
 
@@ -865,21 +865,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;