diff options
author | beck <> | 2017-01-26 10:40:21 +0000 |
---|---|---|
committer | beck <> | 2017-01-26 10:40:21 +0000 |
commit | 59161dbdf4da5b82b27402f93d7007a11b2d1cc1 (patch) | |
tree | e105a2b33d3aefb54727a955e9c746cc8edb0e50 /src/lib/libssl/d1_both.c | |
parent | a2e1efdba084d65702b419bc510c30a144eb5d7f (diff) | |
download | openbsd-59161dbdf4da5b82b27402f93d7007a11b2d1cc1.tar.gz openbsd-59161dbdf4da5b82b27402f93d7007a11b2d1cc1.tar.bz2 openbsd-59161dbdf4da5b82b27402f93d7007a11b2d1cc1.zip |
Send the error function codes to rot in the depths of hell where they belong
We leave a single funciton code (0xFFF) to say "SSL_internal" so the public
API will not break, and we replace all internal use of the two argument
SSL_err() with the internal only SSL_error() that only takes a reason code.
ok jsing@
Diffstat (limited to 'src/lib/libssl/d1_both.c')
-rw-r--r-- | src/lib/libssl/d1_both.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/lib/libssl/d1_both.c b/src/lib/libssl/d1_both.c index a9a4c1a13b..fb7e289d96 100644 --- a/src/lib/libssl/d1_both.c +++ b/src/lib/libssl/d1_both.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: d1_both.c,v 1.46 2017/01/23 13:36:12 jsing Exp $ */ | 1 | /* $OpenBSD: d1_both.c,v 1.47 2017/01/26 10:40:21 beck Exp $ */ |
2 | /* | 2 | /* |
3 | * DTLS implementation written by Nagendra Modadugu | 3 | * DTLS implementation written by Nagendra Modadugu |
4 | * (nagendra@cs.stanford.edu) for the OpenSSL project 2005. | 4 | * (nagendra@cs.stanford.edu) for the OpenSSL project 2005. |
@@ -410,7 +410,7 @@ dtls1_get_message(SSL *s, int st1, int stn, int mt, long max, int *ok) | |||
410 | S3I(s)->tmp.reuse_message = 0; | 410 | S3I(s)->tmp.reuse_message = 0; |
411 | if ((mt >= 0) && (S3I(s)->tmp.message_type != mt)) { | 411 | if ((mt >= 0) && (S3I(s)->tmp.message_type != mt)) { |
412 | al = SSL_AD_UNEXPECTED_MESSAGE; | 412 | al = SSL_AD_UNEXPECTED_MESSAGE; |
413 | SSLerr(SSL_F_DTLS1_GET_MESSAGE, | 413 | SSLerror( |
414 | SSL_R_UNEXPECTED_MESSAGE); | 414 | SSL_R_UNEXPECTED_MESSAGE); |
415 | goto f_err; | 415 | goto f_err; |
416 | } | 416 | } |
@@ -476,13 +476,13 @@ dtls1_preprocess_fragment(SSL *s, struct hm_header_st *msg_hdr, int max) | |||
476 | 476 | ||
477 | /* sanity checking */ | 477 | /* sanity checking */ |
478 | if ((frag_off + frag_len) > msg_len) { | 478 | if ((frag_off + frag_len) > msg_len) { |
479 | SSLerr(SSL_F_DTLS1_PREPROCESS_FRAGMENT, | 479 | SSLerror( |
480 | SSL_R_EXCESSIVE_MESSAGE_SIZE); | 480 | SSL_R_EXCESSIVE_MESSAGE_SIZE); |
481 | return SSL_AD_ILLEGAL_PARAMETER; | 481 | return SSL_AD_ILLEGAL_PARAMETER; |
482 | } | 482 | } |
483 | 483 | ||
484 | if ((frag_off + frag_len) > (unsigned long)max) { | 484 | if ((frag_off + frag_len) > (unsigned long)max) { |
485 | SSLerr(SSL_F_DTLS1_PREPROCESS_FRAGMENT, | 485 | SSLerror( |
486 | SSL_R_EXCESSIVE_MESSAGE_SIZE); | 486 | SSL_R_EXCESSIVE_MESSAGE_SIZE); |
487 | return SSL_AD_ILLEGAL_PARAMETER; | 487 | return SSL_AD_ILLEGAL_PARAMETER; |
488 | } | 488 | } |
@@ -495,7 +495,7 @@ dtls1_preprocess_fragment(SSL *s, struct hm_header_st *msg_hdr, int max) | |||
495 | */ | 495 | */ |
496 | if (!BUF_MEM_grow_clean(s->internal->init_buf, | 496 | if (!BUF_MEM_grow_clean(s->internal->init_buf, |
497 | msg_len + DTLS1_HM_HEADER_LENGTH)) { | 497 | msg_len + DTLS1_HM_HEADER_LENGTH)) { |
498 | SSLerr(SSL_F_DTLS1_PREPROCESS_FRAGMENT, ERR_R_BUF_LIB); | 498 | SSLerror(ERR_R_BUF_LIB); |
499 | return SSL_AD_INTERNAL_ERROR; | 499 | return SSL_AD_INTERNAL_ERROR; |
500 | } | 500 | } |
501 | 501 | ||
@@ -509,7 +509,7 @@ dtls1_preprocess_fragment(SSL *s, struct hm_header_st *msg_hdr, int max) | |||
509 | * They must be playing with us! BTW, failure to enforce | 509 | * They must be playing with us! BTW, failure to enforce |
510 | * upper limit would open possibility for buffer overrun. | 510 | * upper limit would open possibility for buffer overrun. |
511 | */ | 511 | */ |
512 | SSLerr(SSL_F_DTLS1_PREPROCESS_FRAGMENT, | 512 | SSLerror( |
513 | SSL_R_EXCESSIVE_MESSAGE_SIZE); | 513 | SSL_R_EXCESSIVE_MESSAGE_SIZE); |
514 | return SSL_AD_ILLEGAL_PARAMETER; | 514 | return SSL_AD_ILLEGAL_PARAMETER; |
515 | } | 515 | } |
@@ -803,7 +803,7 @@ again: | |||
803 | /* parse the message fragment header */ | 803 | /* parse the message fragment header */ |
804 | dtls1_get_message_header(wire, &msg_hdr) == 0) { | 804 | dtls1_get_message_header(wire, &msg_hdr) == 0) { |
805 | al = SSL_AD_UNEXPECTED_MESSAGE; | 805 | al = SSL_AD_UNEXPECTED_MESSAGE; |
806 | SSLerr(SSL_F_DTLS1_GET_MESSAGE_FRAGMENT, | 806 | SSLerror( |
807 | SSL_R_UNEXPECTED_MESSAGE); | 807 | SSL_R_UNEXPECTED_MESSAGE); |
808 | goto f_err; | 808 | goto f_err; |
809 | } | 809 | } |
@@ -846,7 +846,7 @@ again: | |||
846 | else /* Incorrectly formated Hello request */ | 846 | else /* Incorrectly formated Hello request */ |
847 | { | 847 | { |
848 | al = SSL_AD_UNEXPECTED_MESSAGE; | 848 | al = SSL_AD_UNEXPECTED_MESSAGE; |
849 | SSLerr(SSL_F_DTLS1_GET_MESSAGE_FRAGMENT, | 849 | SSLerror( |
850 | SSL_R_UNEXPECTED_MESSAGE); | 850 | SSL_R_UNEXPECTED_MESSAGE); |
851 | goto f_err; | 851 | goto f_err; |
852 | } | 852 | } |
@@ -878,7 +878,7 @@ again: | |||
878 | */ | 878 | */ |
879 | if (i != (int)frag_len) { | 879 | if (i != (int)frag_len) { |
880 | al = SSL3_AD_ILLEGAL_PARAMETER; | 880 | al = SSL3_AD_ILLEGAL_PARAMETER; |
881 | SSLerr(SSL_F_DTLS1_GET_MESSAGE_FRAGMENT, | 881 | SSLerror( |
882 | SSL3_AD_ILLEGAL_PARAMETER); | 882 | SSL3_AD_ILLEGAL_PARAMETER); |
883 | goto f_err; | 883 | goto f_err; |
884 | } | 884 | } |