diff options
author | jsing <> | 2020-01-21 05:19:02 +0000 |
---|---|---|
committer | jsing <> | 2020-01-21 05:19:02 +0000 |
commit | 460496e02df69c7c7be18c9b45a095914ee59be4 (patch) | |
tree | db92f8cad8bd91994d19bc6916dbc4522fb4ef95 /src | |
parent | f9666f9db9296ab0643d410ce0eb3486772e422d (diff) | |
download | openbsd-460496e02df69c7c7be18c9b45a095914ee59be4.tar.gz openbsd-460496e02df69c7c7be18c9b45a095914ee59be4.tar.bz2 openbsd-460496e02df69c7c7be18c9b45a095914ee59be4.zip |
Provide SSL_R_UNKNOWN.
This allows us to indicate that the cause of the failure is unknown, rather
than implying that it was an internal error when it was not.
ok beck@
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/libssl/ssl.h | 3 | ||||
-rw-r--r-- | src/lib/libssl/ssl_err.c | 5 | ||||
-rw-r--r-- | src/lib/libssl/tls13_lib.c | 4 |
3 files changed, 7 insertions, 5 deletions
diff --git a/src/lib/libssl/ssl.h b/src/lib/libssl/ssl.h index 521fb537de..8ac05ca70f 100644 --- a/src/lib/libssl/ssl.h +++ b/src/lib/libssl/ssl.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ssl.h,v 1.167 2020/01/02 06:37:13 jsing Exp $ */ | 1 | /* $OpenBSD: ssl.h,v 1.168 2020/01/21 05:19:02 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 | * |
@@ -2162,6 +2162,7 @@ void ERR_load_SSL_strings(void); | |||
2162 | #define SSL_R_X509_LIB 268 | 2162 | #define SSL_R_X509_LIB 268 |
2163 | #define SSL_R_X509_VERIFICATION_SETUP_PROBLEMS 269 | 2163 | #define SSL_R_X509_VERIFICATION_SETUP_PROBLEMS 269 |
2164 | #define SSL_R_PEER_BEHAVING_BADLY 666 | 2164 | #define SSL_R_PEER_BEHAVING_BADLY 666 |
2165 | #define SSL_R_UNKNOWN 999 | ||
2165 | 2166 | ||
2166 | /* | 2167 | /* |
2167 | * OpenSSL compatible OPENSSL_INIT options | 2168 | * OpenSSL compatible OPENSSL_INIT options |
diff --git a/src/lib/libssl/ssl_err.c b/src/lib/libssl/ssl_err.c index 250a9eef6b..cbc2898234 100644 --- a/src/lib/libssl/ssl_err.c +++ b/src/lib/libssl/ssl_err.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ssl_err.c,v 1.36 2018/03/20 15:28:12 tb Exp $ */ | 1 | /* $OpenBSD: ssl_err.c,v 1.37 2020/01/21 05:19:02 jsing Exp $ */ |
2 | /* ==================================================================== | 2 | /* ==================================================================== |
3 | * Copyright (c) 1999-2011 The OpenSSL Project. All rights reserved. | 3 | * Copyright (c) 1999-2011 The OpenSSL Project. All rights reserved. |
4 | * | 4 | * |
@@ -462,7 +462,8 @@ static ERR_STRING_DATA SSL_str_reasons[]= { | |||
462 | {ERR_REASON(SSL_R_WRONG_VERSION_NUMBER) , "wrong version number"}, | 462 | {ERR_REASON(SSL_R_WRONG_VERSION_NUMBER) , "wrong version number"}, |
463 | {ERR_REASON(SSL_R_X509_LIB) , "x509 lib"}, | 463 | {ERR_REASON(SSL_R_X509_LIB) , "x509 lib"}, |
464 | {ERR_REASON(SSL_R_X509_VERIFICATION_SETUP_PROBLEMS), "x509 verification setup problems"}, | 464 | {ERR_REASON(SSL_R_X509_VERIFICATION_SETUP_PROBLEMS), "x509 verification setup problems"}, |
465 | {ERR_REASON(SSL_R_PEER_BEHAVING_BADLY) ,"peer is doing strange or hostile things"}, | 465 | {ERR_REASON(SSL_R_PEER_BEHAVING_BADLY), "peer is doing strange or hostile things"}, |
466 | {ERR_REASON(SSL_R_UNKNOWN), "unknown failure occurred"}, | ||
466 | {0, NULL} | 467 | {0, NULL} |
467 | }; | 468 | }; |
468 | 469 | ||
diff --git a/src/lib/libssl/tls13_lib.c b/src/lib/libssl/tls13_lib.c index fbd7a9a83a..451e798cb8 100644 --- a/src/lib/libssl/tls13_lib.c +++ b/src/lib/libssl/tls13_lib.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: tls13_lib.c,v 1.15 2020/01/21 04:45:18 tb Exp $ */ | 1 | /* $OpenBSD: tls13_lib.c,v 1.16 2020/01/21 05:19:02 jsing Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2018, 2019 Joel Sing <jsing@openbsd.org> | 3 | * Copyright (c) 2018, 2019 Joel Sing <jsing@openbsd.org> |
4 | * Copyright (c) 2019 Bob Beck <beck@openbsd.org> | 4 | * Copyright (c) 2019 Bob Beck <beck@openbsd.org> |
@@ -346,7 +346,7 @@ static void | |||
346 | tls13_legacy_error(SSL *ssl) | 346 | tls13_legacy_error(SSL *ssl) |
347 | { | 347 | { |
348 | struct tls13_ctx *ctx = ssl->internal->tls13; | 348 | struct tls13_ctx *ctx = ssl->internal->tls13; |
349 | int reason = ERR_R_INTERNAL_ERROR; | 349 | int reason = SSL_R_UNKNOWN; |
350 | 350 | ||
351 | switch (ctx->error.code) { | 351 | switch (ctx->error.code) { |
352 | case TLS13_ERR_VERIFY_FAILED: | 352 | case TLS13_ERR_VERIFY_FAILED: |