X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fsrc%2Ftls-openssl.c;h=e45ebd3be736b2535bec063acd79822c54a0b03b;hb=c895de68398ece932fb371f527e24ce233f6ac7b;hp=7a625a8ba10ca2c8ce1ae516372f21bdcc2d983a;hpb=86ede124f0ce622b4f73e05504abc11fece021e3;p=user%2Fhenk%2Fcode%2Fexim.git diff --git a/src/src/tls-openssl.c b/src/src/tls-openssl.c index 7a625a8ba..e45ebd3be 100644 --- a/src/src/tls-openssl.c +++ b/src/src/tls-openssl.c @@ -76,6 +76,9 @@ change this guard and punt the issue for a while longer. */ # define EXIM_HAVE_SESSION_TICKET # define EXIM_HAVE_OPESSL_TRACE # define EXIM_HAVE_OPESSL_GET0_SERIAL +# ifndef DISABLE_OCSP +# define EXIM_HAVE_OCSP +# endif # else # define EXIM_NEED_OPENSSL_INIT # endif @@ -102,6 +105,8 @@ change this guard and punt the issue for a while longer. */ # define OPENSSL_HAVE_KEYLOG_CB # define OPENSSL_HAVE_NUM_TICKETS # define EXIM_HAVE_OPENSSL_CIPHER_STD_NAME +# else +# define OPENSSL_BAD_SRVR_OURCERT # endif #endif @@ -266,6 +271,13 @@ builtin_macro_create_var(US"_RESUME_DECODE", RESUME_DECODE_STRING ); # ifdef SSL_OP_NO_TLSv1_3 builtin_macro_create(US"_HAVE_TLS1_3"); # endif +# ifdef OPENSSL_BAD_SRVR_OURCERT +builtin_macro_create(US"_TLS_BAD_MULTICERT_IN_OURCERT"); +# endif +# ifdef EXIM_HAVE_OCSP +builtin_macro_create(US"_HAVE_TLS_OCSP"); +builtin_macro_create(US"_HAVE_TLS_OCSP_LIST"); +# endif } #else @@ -1841,13 +1853,13 @@ OCSP_RESPONSE * rsp; OCSP_BASICRESP * bs; int i; -DEBUG(D_tls) debug_printf("Received TLS status response (OCSP stapling):\n"); +DEBUG(D_tls) debug_printf("Received TLS status callback (OCSP stapling):\n"); len = SSL_get_tlsext_status_ocsp_resp(s, &p); if(!p) { /* Expect this when we requested ocsp but got none */ if (cbinfo->u_ocsp.client.verify_required && LOGGING(tls_cipher)) - log_write(0, LOG_MAIN, "Received TLS status callback, null content"); + log_write(0, LOG_MAIN, "Required TLS certificate status not received"); else DEBUG(D_tls) debug_printf(" null\n"); return cbinfo->u_ocsp.client.verify_required ? 0 : 1; @@ -2335,7 +2347,11 @@ if (tlsp->peercert) for resumption next to the TLS session, and used here. */ if (!tlsp->verify_override) - tlsp->certificate_verified = SSL_get_verify_result(ssl) == X509_V_OK; + tlsp->certificate_verified = +#ifdef SUPPORT_DANE + tlsp->dane_verified || +#endif + SSL_get_verify_result(ssl) == X509_V_OK; } } @@ -2706,8 +2722,14 @@ if (rc <= 0) /* Handle genuine errors */ case SSL_ERROR_SSL: - (void) tls_error(US"SSL_accept", NULL, sigalrm_seen ? US"timed out" : NULL, errstr); + { + uschar * s = US"SSL_accept"; + unsigned long e = ERR_peek_error(); + if (ERR_GET_REASON(e) == SSL_R_WRONG_VERSION_NUMBER) + s = string_sprintf("%s (%s)", s, SSL_get_version(server_ssl)); + (void) tls_error(s, NULL, sigalrm_seen ? US"timed out" : NULL, errstr); return FAIL; + } default: DEBUG(D_tls) debug_printf("Got SSL error %d\n", error);