From 8d9af885ed2035da2738bf51ed38e738a4c442de Mon Sep 17 00:00:00 2001 From: Bob Beck Date: Tue, 7 Feb 2017 02:08:39 +0000 Subject: 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 --- lib/libssl/d1_clnt.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/libssl/d1_clnt.c') diff --git a/lib/libssl/d1_clnt.c b/lib/libssl/d1_clnt.c index 6e124c7a855..8e4c2586a30 100644 --- a/lib/libssl/d1_clnt.c +++ b/lib/libssl/d1_clnt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: d1_clnt.c,v 1.73 2017/01/26 12:16:13 beck Exp $ */ +/* $OpenBSD: d1_clnt.c,v 1.74 2017/02/07 02:08:38 beck Exp $ */ /* * DTLS implementation written by Nagendra Modadugu * (nagendra@cs.stanford.edu) for the OpenSSL project 2005. @@ -216,7 +216,7 @@ dtls1_connect(SSL *s) cb(s, SSL_CB_HANDSHAKE_START, 1); if ((s->version & 0xff00 ) != (DTLS1_VERSION & 0xff00)) { - SSLerror(ERR_R_INTERNAL_ERROR); + SSLerror(s, ERR_R_INTERNAL_ERROR); ret = -1; goto end; } @@ -570,7 +570,7 @@ dtls1_connect(SSL *s) /* break; */ default: - SSLerror(SSL_R_UNKNOWN_STATE); + SSLerror(s, SSL_R_UNKNOWN_STATE); ret = -1; goto end; /* break; */ @@ -631,7 +631,7 @@ dtls1_get_hello_verify(SSL *s) goto truncated; if (ssl_version != s->version) { - SSLerror(SSL_R_WRONG_SSL_VERSION); + SSLerror(s, SSL_R_WRONG_SSL_VERSION); s->version = (s->version & 0xff00) | (ssl_version & 0xff); al = SSL_AD_PROTOCOL_VERSION; goto f_err; -- cgit v1.2.3