diff options
author | jsing <> | 2015-09-02 17:53:54 +0000 |
---|---|---|
committer | jsing <> | 2015-09-02 17:53:54 +0000 |
commit | 7a0325c92218252068766465cba0cc0eb35d0c93 (patch) | |
tree | c2dfd90e935db96b794945eb8f0d387aebff1888 | |
parent | 3de14ad586708e2fcccc01fc78bc496655a2bb96 (diff) | |
download | openbsd-7a0325c92218252068766465cba0cc0eb35d0c93.tar.gz openbsd-7a0325c92218252068766465cba0cc0eb35d0c93.tar.bz2 openbsd-7a0325c92218252068766465cba0cc0eb35d0c93.zip |
Fewer magic numbers - we already have defines for the header lengths, so
make use of them.
ok doug@
-rw-r--r-- | src/lib/libssl/s23_clnt.c | 12 | ||||
-rw-r--r-- | src/lib/libssl/src/ssl/s23_clnt.c | 12 |
2 files changed, 14 insertions, 10 deletions
diff --git a/src/lib/libssl/s23_clnt.c b/src/lib/libssl/s23_clnt.c index b6c058ece5..96b9ac9429 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.43 2015/09/01 13:38:27 jsing Exp $ */ | 1 | /* $OpenBSD: s23_clnt.c,v 1.44 2015/09/02 17:53:54 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 | * |
@@ -319,7 +319,8 @@ ssl23_client_hello(SSL *s) | |||
319 | version_major = TLS1_VERSION_MAJOR; | 319 | version_major = TLS1_VERSION_MAJOR; |
320 | version_minor = TLS1_VERSION_MINOR; | 320 | version_minor = TLS1_VERSION_MINOR; |
321 | } else { | 321 | } else { |
322 | SSLerr(SSL_F_SSL23_CLIENT_HELLO, SSL_R_NO_PROTOCOLS_AVAILABLE); | 322 | SSLerr(SSL_F_SSL23_CLIENT_HELLO, |
323 | SSL_R_NO_PROTOCOLS_AVAILABLE); | ||
323 | return (-1); | 324 | return (-1); |
324 | } | 325 | } |
325 | 326 | ||
@@ -331,7 +332,7 @@ ssl23_client_hello(SSL *s) | |||
331 | * Do the record header (5 bytes) and handshake | 332 | * Do the record header (5 bytes) and handshake |
332 | * message header (4 bytes) last | 333 | * message header (4 bytes) last |
333 | */ | 334 | */ |
334 | d = p = &(buf[9]); | 335 | d = p = &(buf[SSL3_RT_HEADER_LENGTH + SSL3_HM_HEADER_LENGTH]); |
335 | 336 | ||
336 | *(p++) = version_major; | 337 | *(p++) = version_major; |
337 | *(p++) = version_minor; | 338 | *(p++) = version_minor; |
@@ -368,7 +369,7 @@ ssl23_client_hello(SSL *s) | |||
368 | l = p - d; | 369 | l = p - d; |
369 | 370 | ||
370 | /* fill in 4-byte handshake header */ | 371 | /* fill in 4-byte handshake header */ |
371 | d = &(buf[5]); | 372 | d = &(buf[SSL3_RT_HEADER_LENGTH]); |
372 | *(d++) = SSL3_MT_CLIENT_HELLO; | 373 | *(d++) = SSL3_MT_CLIENT_HELLO; |
373 | l2n3(l, d); | 374 | l2n3(l, d); |
374 | 375 | ||
@@ -398,7 +399,8 @@ ssl23_client_hello(SSL *s) | |||
398 | s->init_num = p - buf; | 399 | s->init_num = p - buf; |
399 | s->init_off = 0; | 400 | s->init_off = 0; |
400 | 401 | ||
401 | ssl3_finish_mac(s, &(buf[5]), s->init_num - 5); | 402 | ssl3_finish_mac(s, &(buf[SSL3_RT_HEADER_LENGTH]), |
403 | s->init_num - SSL3_RT_HEADER_LENGTH); | ||
402 | 404 | ||
403 | s->state = SSL23_ST_CW_CLNT_HELLO_B; | 405 | s->state = SSL23_ST_CW_CLNT_HELLO_B; |
404 | s->init_off = 0; | 406 | s->init_off = 0; |
diff --git a/src/lib/libssl/src/ssl/s23_clnt.c b/src/lib/libssl/src/ssl/s23_clnt.c index b6c058ece5..96b9ac9429 100644 --- a/src/lib/libssl/src/ssl/s23_clnt.c +++ b/src/lib/libssl/src/ssl/s23_clnt.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: s23_clnt.c,v 1.43 2015/09/01 13:38:27 jsing Exp $ */ | 1 | /* $OpenBSD: s23_clnt.c,v 1.44 2015/09/02 17:53:54 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 | * |
@@ -319,7 +319,8 @@ ssl23_client_hello(SSL *s) | |||
319 | version_major = TLS1_VERSION_MAJOR; | 319 | version_major = TLS1_VERSION_MAJOR; |
320 | version_minor = TLS1_VERSION_MINOR; | 320 | version_minor = TLS1_VERSION_MINOR; |
321 | } else { | 321 | } else { |
322 | SSLerr(SSL_F_SSL23_CLIENT_HELLO, SSL_R_NO_PROTOCOLS_AVAILABLE); | 322 | SSLerr(SSL_F_SSL23_CLIENT_HELLO, |
323 | SSL_R_NO_PROTOCOLS_AVAILABLE); | ||
323 | return (-1); | 324 | return (-1); |
324 | } | 325 | } |
325 | 326 | ||
@@ -331,7 +332,7 @@ ssl23_client_hello(SSL *s) | |||
331 | * Do the record header (5 bytes) and handshake | 332 | * Do the record header (5 bytes) and handshake |
332 | * message header (4 bytes) last | 333 | * message header (4 bytes) last |
333 | */ | 334 | */ |
334 | d = p = &(buf[9]); | 335 | d = p = &(buf[SSL3_RT_HEADER_LENGTH + SSL3_HM_HEADER_LENGTH]); |
335 | 336 | ||
336 | *(p++) = version_major; | 337 | *(p++) = version_major; |
337 | *(p++) = version_minor; | 338 | *(p++) = version_minor; |
@@ -368,7 +369,7 @@ ssl23_client_hello(SSL *s) | |||
368 | l = p - d; | 369 | l = p - d; |
369 | 370 | ||
370 | /* fill in 4-byte handshake header */ | 371 | /* fill in 4-byte handshake header */ |
371 | d = &(buf[5]); | 372 | d = &(buf[SSL3_RT_HEADER_LENGTH]); |
372 | *(d++) = SSL3_MT_CLIENT_HELLO; | 373 | *(d++) = SSL3_MT_CLIENT_HELLO; |
373 | l2n3(l, d); | 374 | l2n3(l, d); |
374 | 375 | ||
@@ -398,7 +399,8 @@ ssl23_client_hello(SSL *s) | |||
398 | s->init_num = p - buf; | 399 | s->init_num = p - buf; |
399 | s->init_off = 0; | 400 | s->init_off = 0; |
400 | 401 | ||
401 | ssl3_finish_mac(s, &(buf[5]), s->init_num - 5); | 402 | ssl3_finish_mac(s, &(buf[SSL3_RT_HEADER_LENGTH]), |
403 | s->init_num - SSL3_RT_HEADER_LENGTH); | ||
402 | 404 | ||
403 | s->state = SSL23_ST_CW_CLNT_HELLO_B; | 405 | s->state = SSL23_ST_CW_CLNT_HELLO_B; |
404 | s->init_off = 0; | 406 | s->init_off = 0; |