summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortb <>2020-09-01 05:38:48 +0000
committertb <>2020-09-01 05:38:48 +0000
commit11277d790262bfb3e147758afd8e7cfec21cafe0 (patch)
tree8cfd15e485ec833b07ecd354d7d083f017d25aba
parent9a896a8c68a5bbc7e0c50b709ff9c34e5453473e (diff)
downloadopenbsd-11277d790262bfb3e147758afd8e7cfec21cafe0.tar.gz
openbsd-11277d790262bfb3e147758afd8e7cfec21cafe0.tar.bz2
openbsd-11277d790262bfb3e147758afd8e7cfec21cafe0.zip
Hoist ERR_clear_error() call into the derr: label
The only path that sets TLS1_TICKET_NOT_DECRPYTED is through this label and the ERR_clear_error() is called conditionally on this. We clear the errors to make decrypt errors non-fatal. The free functions should not set the errors and if they do, we don't want to hide that. discussed with jsing
-rw-r--r--src/lib/libssl/t1_lib.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/lib/libssl/t1_lib.c b/src/lib/libssl/t1_lib.c
index 64e64bf902..8162259c66 100644
--- a/src/lib/libssl/t1_lib.c
+++ b/src/lib/libssl/t1_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: t1_lib.c,v 1.172 2020/09/01 05:32:11 tb Exp $ */ 1/* $OpenBSD: t1_lib.c,v 1.173 2020/09/01 05:38:48 tb 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 *
@@ -1012,6 +1012,7 @@ tls_decrypt_ticket(SSL *s, CBS *session_id, CBS *ticket, int *alert,
1012 goto done; 1012 goto done;
1013 1013
1014 derr: 1014 derr:
1015 ERR_clear_error();
1015 s->internal->tlsext_ticket_expected = 1; 1016 s->internal->tlsext_ticket_expected = 1;
1016 ret = TLS1_TICKET_NOT_DECRYPTED; 1017 ret = TLS1_TICKET_NOT_DECRYPTED;
1017 goto done; 1018 goto done;
@@ -1027,8 +1028,5 @@ tls_decrypt_ticket(SSL *s, CBS *session_id, CBS *ticket, int *alert,
1027 HMAC_CTX_free(hctx); 1028 HMAC_CTX_free(hctx);
1028 SSL_SESSION_free(sess); 1029 SSL_SESSION_free(sess);
1029 1030
1030 if (ret == TLS1_TICKET_NOT_DECRYPTED)
1031 ERR_clear_error();
1032
1033 return ret; 1031 return ret;
1034} 1032}