summaryrefslogtreecommitdiff
path: root/src/lib/libssl/s23_clnt.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libssl/s23_clnt.c')
-rw-r--r--src/lib/libssl/s23_clnt.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/lib/libssl/s23_clnt.c b/src/lib/libssl/s23_clnt.c
index c6920e2b34..8674cdf627 100644
--- a/src/lib/libssl/s23_clnt.c
+++ b/src/lib/libssl/s23_clnt.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: s23_clnt.c,v 1.46 2015/09/11 18:08:21 jsing Exp $ */ 1/* $OpenBSD: s23_clnt.c,v 1.47 2016/12/04 14:32:30 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 *
@@ -230,11 +230,11 @@ ssl23_client_hello(SSL *s)
230{ 230{
231 unsigned char *buf; 231 unsigned char *buf;
232 unsigned char *p, *d; 232 unsigned char *p, *d;
233 int i;
234 unsigned long l; 233 unsigned long l;
235 int version = 0, version_major, version_minor; 234 int version = 0, version_major, version_minor;
236 int ret; 235 int ret;
237 unsigned long mask, options = s->options; 236 unsigned long mask, options = s->options;
237 size_t outlen;
238 238
239 /* 239 /*
240 * SSL_OP_NO_X disables all protocols above X *if* there are 240 * SSL_OP_NO_X disables all protocols above X *if* there are
@@ -294,14 +294,16 @@ ssl23_client_hello(SSL *s)
294 *(p++) = 0; 294 *(p++) = 0;
295 295
296 /* Ciphers supported (using SSL 3.0/TLS 1.0 format) */ 296 /* Ciphers supported (using SSL 3.0/TLS 1.0 format) */
297 i = ssl_cipher_list_to_bytes(s, SSL_get_ciphers(s), &p[2]); 297 if (!ssl_cipher_list_to_bytes(s, SSL_get_ciphers(s), &p[2],
298 if (i == 0) { 298 buf - &p[2] + SSL3_RT_MAX_PLAIN_LENGTH, &outlen))
299 SSLerr(SSL_F_SSL23_CLIENT_HELLO, 299 return -1;
300 if (outlen == 0) {
301 SSLerr(SSL_F_SSL3_CLIENT_HELLO,
300 SSL_R_NO_CIPHERS_AVAILABLE); 302 SSL_R_NO_CIPHERS_AVAILABLE);
301 return -1; 303 return -1;
302 } 304 }
303 s2n(i, p); 305 s2n(outlen, p);
304 p += i; 306 p += outlen;
305 307
306 /* add in (no) COMPRESSION */ 308 /* add in (no) COMPRESSION */
307 *(p++) = 1; 309 *(p++) = 1;