summaryrefslogtreecommitdiff
path: root/src/lib/libssl/d1_srvr.c
diff options
context:
space:
mode:
authorbeck <>2017-02-07 02:08:38 +0000
committerbeck <>2017-02-07 02:08:38 +0000
commit91c389f89015a024212e73f5ec6e24166955ab6e (patch)
treea4e6a6d2d23329b576b63c8698e62a87e7388b69 /src/lib/libssl/d1_srvr.c
parent8a1ec4c748b269fba0669ee71234ec9a0f128613 (diff)
downloadopenbsd-91c389f89015a024212e73f5ec6e24166955ab6e.tar.gz
openbsd-91c389f89015a024212e73f5ec6e24166955ab6e.tar.bz2
openbsd-91c389f89015a024212e73f5ec6e24166955ab6e.zip
Change SSLerror() back to taking two args, with the first one being an SSL *.
Make a table of "function codes" which maps the internal state of the SSL * to something like a useful name so in a typical error in the connection you know in what sort of place in the handshake things happened. (instead of by arcane function name). Add SSLerrorx() for when we don't have an SSL * ok jsing@ after us both being prodded by bluhm@ to make it not terrible
Diffstat (limited to 'src/lib/libssl/d1_srvr.c')
-rw-r--r--src/lib/libssl/d1_srvr.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/lib/libssl/d1_srvr.c b/src/lib/libssl/d1_srvr.c
index fa860b8d5a..860a5fc4e3 100644
--- a/src/lib/libssl/d1_srvr.c
+++ b/src/lib/libssl/d1_srvr.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: d1_srvr.c,v 1.83 2017/01/26 12:16:13 beck Exp $ */ 1/* $OpenBSD: d1_srvr.c,v 1.84 2017/02/07 02:08:38 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.
@@ -202,7 +202,7 @@ dtls1_accept(SSL *s)
202 D1I(s)->listen = listen; 202 D1I(s)->listen = listen;
203 203
204 if (s->cert == NULL) { 204 if (s->cert == NULL) {
205 SSLerror(SSL_R_NO_CERTIFICATE_SET); 205 SSLerror(s, SSL_R_NO_CERTIFICATE_SET);
206 ret = -1; 206 ret = -1;
207 goto end; 207 goto end;
208 } 208 }
@@ -225,7 +225,7 @@ dtls1_accept(SSL *s)
225 cb(s, SSL_CB_HANDSHAKE_START, 1); 225 cb(s, SSL_CB_HANDSHAKE_START, 1);
226 226
227 if ((s->version & 0xff00) != (DTLS1_VERSION & 0xff00)) { 227 if ((s->version & 0xff00) != (DTLS1_VERSION & 0xff00)) {
228 SSLerror(ERR_R_INTERNAL_ERROR); 228 SSLerror(s, ERR_R_INTERNAL_ERROR);
229 ret = -1; 229 ret = -1;
230 goto end; 230 goto end;
231 } 231 }
@@ -506,7 +506,7 @@ dtls1_accept(SSL *s)
506 * at this point and digest cached records. 506 * at this point and digest cached records.
507 */ 507 */
508 if (!S3I(s)->handshake_buffer) { 508 if (!S3I(s)->handshake_buffer) {
509 SSLerror(ERR_R_INTERNAL_ERROR); 509 SSLerror(s, ERR_R_INTERNAL_ERROR);
510 ret = -1; 510 ret = -1;
511 goto end; 511 goto end;
512 } 512 }
@@ -658,7 +658,7 @@ dtls1_accept(SSL *s)
658 /* break; */ 658 /* break; */
659 659
660 default: 660 default:
661 SSLerror(SSL_R_UNKNOWN_STATE); 661 SSLerror(s, SSL_R_UNKNOWN_STATE);
662 ret = -1; 662 ret = -1;
663 goto end; 663 goto end;
664 /* break; */ 664 /* break; */
@@ -705,7 +705,7 @@ dtls1_send_hello_verify_request(SSL *s)
705 if (s->ctx->internal->app_gen_cookie_cb == NULL || 705 if (s->ctx->internal->app_gen_cookie_cb == NULL ||
706 s->ctx->internal->app_gen_cookie_cb(s, 706 s->ctx->internal->app_gen_cookie_cb(s,
707 D1I(s)->cookie, &(D1I(s)->cookie_len)) == 0) { 707 D1I(s)->cookie, &(D1I(s)->cookie_len)) == 0) {
708 SSLerror(ERR_R_INTERNAL_ERROR); 708 SSLerror(s, ERR_R_INTERNAL_ERROR);
709 return 0; 709 return 0;
710 } 710 }
711 711