summaryrefslogtreecommitdiff
path: root/src/lib/libssl/ssl_both.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libssl/ssl_both.c')
-rw-r--r--src/lib/libssl/ssl_both.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/lib/libssl/ssl_both.c b/src/lib/libssl/ssl_both.c
index 9d0dadef83..707feb6d09 100644
--- a/src/lib/libssl/ssl_both.c
+++ b/src/lib/libssl/ssl_both.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssl_both.c,v 1.2 2017/01/26 06:32:58 jsing Exp $ */ 1/* $OpenBSD: ssl_both.c,v 1.3 2017/01/26 10:40:21 beck 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 *
@@ -244,7 +244,7 @@ ssl3_get_finished(SSL *s, int a, int b)
244 /* If this occurs, we have missed a message */ 244 /* If this occurs, we have missed a message */
245 if (!S3I(s)->change_cipher_spec) { 245 if (!S3I(s)->change_cipher_spec) {
246 al = SSL_AD_UNEXPECTED_MESSAGE; 246 al = SSL_AD_UNEXPECTED_MESSAGE;
247 SSLerr(SSL_F_SSL3_GET_FINISHED, SSL_R_GOT_A_FIN_BEFORE_A_CCS); 247 SSLerror(SSL_R_GOT_A_FIN_BEFORE_A_CCS);
248 goto f_err; 248 goto f_err;
249 } 249 }
250 S3I(s)->change_cipher_spec = 0; 250 S3I(s)->change_cipher_spec = 0;
@@ -253,7 +253,7 @@ ssl3_get_finished(SSL *s, int a, int b)
253 253
254 if (n < 0) { 254 if (n < 0) {
255 al = SSL_AD_DECODE_ERROR; 255 al = SSL_AD_DECODE_ERROR;
256 SSLerr(SSL_F_SSL3_GET_FINISHED, SSL_R_BAD_DIGEST_LENGTH); 256 SSLerror(SSL_R_BAD_DIGEST_LENGTH);
257 goto f_err; 257 goto f_err;
258 } 258 }
259 259
@@ -262,13 +262,13 @@ ssl3_get_finished(SSL *s, int a, int b)
262 if (S3I(s)->tmp.peer_finish_md_len != md_len || 262 if (S3I(s)->tmp.peer_finish_md_len != md_len ||
263 CBS_len(&cbs) != md_len) { 263 CBS_len(&cbs) != md_len) {
264 al = SSL_AD_DECODE_ERROR; 264 al = SSL_AD_DECODE_ERROR;
265 SSLerr(SSL_F_SSL3_GET_FINISHED, SSL_R_BAD_DIGEST_LENGTH); 265 SSLerror(SSL_R_BAD_DIGEST_LENGTH);
266 goto f_err; 266 goto f_err;
267 } 267 }
268 268
269 if (!CBS_mem_equal(&cbs, S3I(s)->tmp.peer_finish_md, CBS_len(&cbs))) { 269 if (!CBS_mem_equal(&cbs, S3I(s)->tmp.peer_finish_md, CBS_len(&cbs))) {
270 al = SSL_AD_DECRYPT_ERROR; 270 al = SSL_AD_DECRYPT_ERROR;
271 SSLerr(SSL_F_SSL3_GET_FINISHED, SSL_R_DIGEST_CHECK_FAILED); 271 SSLerror(SSL_R_DIGEST_CHECK_FAILED);
272 goto f_err; 272 goto f_err;
273 } 273 }
274 274
@@ -365,7 +365,7 @@ ssl3_output_cert_chain(SSL *s, CBB *cbb, X509 *x)
365 365
366 if (!X509_STORE_CTX_init(&xs_ctx, s->ctx->cert_store, 366 if (!X509_STORE_CTX_init(&xs_ctx, s->ctx->cert_store,
367 x, NULL)) { 367 x, NULL)) {
368 SSLerr(SSL_F_SSL3_OUTPUT_CERT_CHAIN, 368 SSLerror(
369 ERR_R_X509_LIB); 369 ERR_R_X509_LIB);
370 goto err; 370 goto err;
371 } 371 }
@@ -420,7 +420,7 @@ ssl3_get_message(SSL *s, int st1, int stn, int mt, long max, int *ok)
420 S3I(s)->tmp.reuse_message = 0; 420 S3I(s)->tmp.reuse_message = 0;
421 if ((mt >= 0) && (S3I(s)->tmp.message_type != mt)) { 421 if ((mt >= 0) && (S3I(s)->tmp.message_type != mt)) {
422 al = SSL_AD_UNEXPECTED_MESSAGE; 422 al = SSL_AD_UNEXPECTED_MESSAGE;
423 SSLerr(SSL_F_SSL3_GET_MESSAGE, 423 SSLerror(
424 SSL_R_UNEXPECTED_MESSAGE); 424 SSL_R_UNEXPECTED_MESSAGE);
425 goto f_err; 425 goto f_err;
426 } 426 }
@@ -473,7 +473,7 @@ ssl3_get_message(SSL *s, int st1, int stn, int mt, long max, int *ok)
473 473
474 if ((mt >= 0) && (*p != mt)) { 474 if ((mt >= 0) && (*p != mt)) {
475 al = SSL_AD_UNEXPECTED_MESSAGE; 475 al = SSL_AD_UNEXPECTED_MESSAGE;
476 SSLerr(SSL_F_SSL3_GET_MESSAGE, 476 SSLerror(
477 SSL_R_UNEXPECTED_MESSAGE); 477 SSL_R_UNEXPECTED_MESSAGE);
478 goto f_err; 478 goto f_err;
479 } 479 }
@@ -481,19 +481,19 @@ ssl3_get_message(SSL *s, int st1, int stn, int mt, long max, int *ok)
481 CBS_init(&cbs, p, 4); 481 CBS_init(&cbs, p, 4);
482 if (!CBS_get_u8(&cbs, &u8) || 482 if (!CBS_get_u8(&cbs, &u8) ||
483 !CBS_get_u24(&cbs, &l)) { 483 !CBS_get_u24(&cbs, &l)) {
484 SSLerr(SSL_F_SSL3_GET_MESSAGE, ERR_R_BUF_LIB); 484 SSLerror(ERR_R_BUF_LIB);
485 goto err; 485 goto err;
486 } 486 }
487 S3I(s)->tmp.message_type = u8; 487 S3I(s)->tmp.message_type = u8;
488 488
489 if (l > (unsigned long)max) { 489 if (l > (unsigned long)max) {
490 al = SSL_AD_ILLEGAL_PARAMETER; 490 al = SSL_AD_ILLEGAL_PARAMETER;
491 SSLerr(SSL_F_SSL3_GET_MESSAGE, 491 SSLerror(
492 SSL_R_EXCESSIVE_MESSAGE_SIZE); 492 SSL_R_EXCESSIVE_MESSAGE_SIZE);
493 goto f_err; 493 goto f_err;
494 } 494 }
495 if (l && !BUF_MEM_grow_clean(s->internal->init_buf, l + 4)) { 495 if (l && !BUF_MEM_grow_clean(s->internal->init_buf, l + 4)) {
496 SSLerr(SSL_F_SSL3_GET_MESSAGE, ERR_R_BUF_LIB); 496 SSLerror(ERR_R_BUF_LIB);
497 goto err; 497 goto err;
498 } 498 }
499 S3I(s)->tmp.message_size = l; 499 S3I(s)->tmp.message_size = l;
@@ -684,7 +684,7 @@ ssl3_setup_read_buffer(SSL *s)
684 return 1; 684 return 1;
685 685
686err: 686err:
687 SSLerr(SSL_F_SSL3_SETUP_READ_BUFFER, ERR_R_MALLOC_FAILURE); 687 SSLerror(ERR_R_MALLOC_FAILURE);
688 return 0; 688 return 0;
689} 689}
690 690
@@ -717,7 +717,7 @@ ssl3_setup_write_buffer(SSL *s)
717 return 1; 717 return 1;
718 718
719err: 719err:
720 SSLerr(SSL_F_SSL3_SETUP_WRITE_BUFFER, ERR_R_MALLOC_FAILURE); 720 SSLerror(ERR_R_MALLOC_FAILURE);
721 return 0; 721 return 0;
722} 722}
723 723