-/* $OpenBSD: s3_clnt.c,v 1.86 2014/08/10 14:42:56 jsing Exp $ */
+/* $OpenBSD: s3_clnt.c,v 1.87 2014/08/11 01:10:42 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
SSL_R_WRONG_CIPHER_RETURNED);
goto f_err;
}
- p += ssl3_put_cipher_by_char(NULL, NULL);
+ p += SSL3_CIPHER_VALUE_SIZE;
sk = ssl_get_ciphers_by_id(s);
i = sk_SSL_CIPHER_find(sk, c);
-/* $OpenBSD: s3_clnt.c,v 1.86 2014/08/10 14:42:56 jsing Exp $ */
+/* $OpenBSD: s3_clnt.c,v 1.87 2014/08/11 01:10:42 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
SSL_R_WRONG_CIPHER_RETURNED);
goto f_err;
}
- p += ssl3_put_cipher_by_char(NULL, NULL);
+ p += SSL3_CIPHER_VALUE_SIZE;
sk = ssl_get_ciphers_by_id(s);
i = sk_SSL_CIPHER_find(sk, c);
-/* $OpenBSD: ssl3.h,v 1.25 2014/07/10 09:26:08 jsing Exp $ */
+/* $OpenBSD: ssl3.h,v 1.26 2014/08/11 01:10:42 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
#define SSL3_SEQUENCE_SIZE 8
#define SSL3_SESSION_ID_SIZE 32
#define SSL3_RT_HEADER_LENGTH 5
+#define SSL3_CIPHER_VALUE_SIZE 2
#ifndef SSL3_ALIGN_PAYLOAD
/* Some will argue that this increases memory footprint, but it's
-/* $OpenBSD: ssl_lib.c,v 1.79 2014/08/10 14:42:56 jsing Exp $ */
+/* $OpenBSD: ssl_lib.c,v 1.80 2014/08/11 01:10:42 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
{
const SSL_CIPHER *c;
STACK_OF(SSL_CIPHER) *sk;
- int i, n;
+ int i;
if (s->s3)
s->s3->send_connection_binding = 0;
- n = ssl3_put_cipher_by_char(NULL, NULL);
- if ((num % n) != 0) {
+ if ((num % SSL3_CIPHER_VALUE_SIZE) != 0) {
SSLerr(SSL_F_SSL_BYTES_TO_CIPHER_LIST,
SSL_R_ERROR_IN_RECEIVED_CIPHER_LIST);
return (NULL);
sk_SSL_CIPHER_zero(sk);
}
- for (i = 0; i < num; i += n) {
+ for (i = 0; i < num; i += SSL3_CIPHER_VALUE_SIZE) {
/* Check for SCSV */
- if (s->s3 && (n != 3 || !p[0]) &&
- (p[n - 2] == ((SSL3_CK_SCSV >> 8) & 0xff)) &&
- (p[n - 1] == (SSL3_CK_SCSV & 0xff))) {
+ if (s->s3 && (p[0] == ((SSL3_CK_SCSV >> 8) & 0xff)) &&
+ (p[1] == (SSL3_CK_SCSV & 0xff))) {
/* SCSV fatal if renegotiating */
if (s->renegotiate) {
SSLerr(SSL_F_SSL_BYTES_TO_CIPHER_LIST,
goto err;
}
s->s3->send_connection_binding = 1;
- p += n;
+ p += SSL3_CIPHER_VALUE_SIZE;
continue;
}
c = ssl3_get_cipher_by_char(p);
- p += n;
+ p += SSL3_CIPHER_VALUE_SIZE;
if (c != NULL) {
if (!sk_SSL_CIPHER_push(sk, c)) {
SSLerr(SSL_F_SSL_BYTES_TO_CIPHER_LIST,
-/* $OpenBSD: ssl3.h,v 1.25 2014/07/10 09:26:08 jsing Exp $ */
+/* $OpenBSD: ssl3.h,v 1.26 2014/08/11 01:10:42 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
#define SSL3_SEQUENCE_SIZE 8
#define SSL3_SESSION_ID_SIZE 32
#define SSL3_RT_HEADER_LENGTH 5
+#define SSL3_CIPHER_VALUE_SIZE 2
#ifndef SSL3_ALIGN_PAYLOAD
/* Some will argue that this increases memory footprint, but it's
-/* $OpenBSD: ssl_lib.c,v 1.79 2014/08/10 14:42:56 jsing Exp $ */
+/* $OpenBSD: ssl_lib.c,v 1.80 2014/08/11 01:10:42 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
{
const SSL_CIPHER *c;
STACK_OF(SSL_CIPHER) *sk;
- int i, n;
+ int i;
if (s->s3)
s->s3->send_connection_binding = 0;
- n = ssl3_put_cipher_by_char(NULL, NULL);
- if ((num % n) != 0) {
+ if ((num % SSL3_CIPHER_VALUE_SIZE) != 0) {
SSLerr(SSL_F_SSL_BYTES_TO_CIPHER_LIST,
SSL_R_ERROR_IN_RECEIVED_CIPHER_LIST);
return (NULL);
sk_SSL_CIPHER_zero(sk);
}
- for (i = 0; i < num; i += n) {
+ for (i = 0; i < num; i += SSL3_CIPHER_VALUE_SIZE) {
/* Check for SCSV */
- if (s->s3 && (n != 3 || !p[0]) &&
- (p[n - 2] == ((SSL3_CK_SCSV >> 8) & 0xff)) &&
- (p[n - 1] == (SSL3_CK_SCSV & 0xff))) {
+ if (s->s3 && (p[0] == ((SSL3_CK_SCSV >> 8) & 0xff)) &&
+ (p[1] == (SSL3_CK_SCSV & 0xff))) {
/* SCSV fatal if renegotiating */
if (s->renegotiate) {
SSLerr(SSL_F_SSL_BYTES_TO_CIPHER_LIST,
goto err;
}
s->s3->send_connection_binding = 1;
- p += n;
+ p += SSL3_CIPHER_VALUE_SIZE;
continue;
}
c = ssl3_get_cipher_by_char(p);
- p += n;
+ p += SSL3_CIPHER_VALUE_SIZE;
if (c != NULL) {
if (!sk_SSL_CIPHER_push(sk, c)) {
SSLerr(SSL_F_SSL_BYTES_TO_CIPHER_LIST,