summaryrefslogtreecommitdiff
path: root/src/lib/libssl/ssl_lib.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/lib/libssl/ssl_lib.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/lib/libssl/ssl_lib.c b/src/lib/libssl/ssl_lib.c
index 5bf43623fc..8ecb37d1be 100644
--- a/src/lib/libssl/ssl_lib.c
+++ b/src/lib/libssl/ssl_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssl_lib.c,v 1.95 2015/01/22 09:12:57 reyk Exp $ */ 1/* $OpenBSD: ssl_lib.c,v 1.96 2015/02/07 05:46:01 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -1420,7 +1420,6 @@ ssl_bytes_to_cipher_list(SSL *s, unsigned char *p, int num,
1420 const SSL_CIPHER *c; 1420 const SSL_CIPHER *c;
1421 STACK_OF(SSL_CIPHER) *sk; 1421 STACK_OF(SSL_CIPHER) *sk;
1422 int i; 1422 int i;
1423 unsigned int cipher_id;
1424 uint16_t cipher_value; 1423 uint16_t cipher_value;
1425 1424
1426 if (s->s3) 1425 if (s->s3)
@@ -1442,10 +1441,9 @@ ssl_bytes_to_cipher_list(SSL *s, unsigned char *p, int num,
1442 1441
1443 for (i = 0; i < num; i += SSL3_CIPHER_VALUE_SIZE) { 1442 for (i = 0; i < num; i += SSL3_CIPHER_VALUE_SIZE) {
1444 n2s(p, cipher_value); 1443 n2s(p, cipher_value);
1445 cipher_id = SSL3_CK_ID | cipher_value;
1446 1444
1447 /* Check for SCSV */ 1445 /* Check for SCSV */
1448 if (s->s3 && cipher_id == SSL3_CK_SCSV) { 1446 if (s->s3 && (SSL3_CK_ID | cipher_value) == SSL3_CK_SCSV) {
1449 /* SCSV is fatal if renegotiating. */ 1447 /* SCSV is fatal if renegotiating. */
1450 if (s->renegotiate) { 1448 if (s->renegotiate) {
1451 SSLerr(SSL_F_SSL_BYTES_TO_CIPHER_LIST, 1449 SSLerr(SSL_F_SSL_BYTES_TO_CIPHER_LIST,
@@ -1459,8 +1457,7 @@ ssl_bytes_to_cipher_list(SSL *s, unsigned char *p, int num,
1459 continue; 1457 continue;
1460 } 1458 }
1461 1459
1462 c = ssl3_get_cipher_by_id(cipher_id); 1460 if ((c = ssl3_get_cipher_by_value(cipher_value)) != NULL) {
1463 if (c != NULL) {
1464 if (!sk_SSL_CIPHER_push(sk, c)) { 1461 if (!sk_SSL_CIPHER_push(sk, c)) {
1465 SSLerr(SSL_F_SSL_BYTES_TO_CIPHER_LIST, 1462 SSLerr(SSL_F_SSL_BYTES_TO_CIPHER_LIST,
1466 ERR_R_MALLOC_FAILURE); 1463 ERR_R_MALLOC_FAILURE);