Make disabling last cipher work.

(Imported from upstream's 8f243ab6c173096943ca079648d240eba1e46dd3)

Change-Id: I929e481842c489aa28f28cf066b4556160a23efe
This commit is contained in:
Adam Langley
2014-07-28 17:05:13 -07:00
parent e532f823d6
commit e3142a788c
+11 -7
View File
@@ -756,7 +756,7 @@ static void ssl_cipher_apply_rule(unsigned long cipher_id,
int rule, int strength_bits, int in_group,
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;
@@ -773,21 +773,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;