1
0
mirror of https://github.com/apache/httpd.git synced 2025-08-07 04:02:58 +03:00

30 Commits

Author SHA1 Message Date
Yann Ylavic
a9a10f36a9 mod_ssl_ct: Fix format warnings.
* modules/ssl/mod_ssl_ct.c(client_extension_add_callback,
                           server_extension_add_callback):
  Variable ext_type is unsigned, so use %u instead of %hu.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1916924 13f79535-47bb-0310-9956-ffa450edef68
2024-04-12 09:56:34 +00:00
Yann Ylavic
1e06568a28 mod_ssl: Fix deprecation warnings with openssl-3.
* mod_ssl_openssl.h:
  Make it the first openssl to be included openssl header, selecting the
  OpenSSL api based on OPENSSL_API_COMPAT eventually.

* ssl_private.h;
  Define OPENSSL_API_COMPAT to version 1.1.1 (last one supporting EGINE_ API)
  before including mod_ssl_openssl.h to enable the ENGINE_ api (TODO: switch to
  new "providers" api before the ENGINE_ api is abandonned..).
  mod_ssl.h is now implicitely included from there.
  Fix preprocessor "#define FOO (COND)" to "#if COND #define FOO 1 #else #define FOO 0".
  Define MODSSL_HAVE_ENGINE_API iff OPENSSL_API_COMPAT < 3.0 (otherwise all the
  engine features are disabled, only "builtin" is accepted).
  Define HAVE_SRP iff OPENSSL_API_COMPAT < 3.0 (no replacement for this api
  above, so it might not be implemenentedain httpd anymore at some point..).
  Define X509_get_not{Before,After} if missing to the non deprecated version.
  New modssl_set_io_callbacks() to factorize compat code for io callbacks.
  ssl_dh_GetParamFromFile() becomes modssl_dh_from_file() for openssl < 3.0 and
  modssl_dh_pkey_from_file() for openssl >= 3.0.

* mod_ssl.c, mod_ssl_ct.c, ssl_util_stapling:
  Including "ssl_private.h" only is suited/enough now.
  
* mod_ssl_ct.c, ssl_ct_log_config:
  Use EVP api with openssl >= 3 instead of the deprecated SHA256 one.

* ssl_engine_config.c(ssl_cmd_SSLCryptoDevice):
  Disabled engines (besides NULL/"builtin"/NULL) unless MODSSL_HAVE_ENGINE_API.

* ssl_engine_init:
  New compat modssl_runtime_lib_version() to address deprecated SSLeay().
  ssl_init_Engine() does nothing unless MODSSL_HAVE_ENGINE_API.
  Simplify ssl_init_server_certs() (less #ifdef-ery) with scoped local vars.
  Compat loading DH parameters and EC curve from cert.

* ssl_engine_io.c, ssl_engine_kernel.c:
  Implement common modssl_set_io_callbacks() and use it.

* ssl_engine_pphrase(modssl_load_engine_keypair):
  Depend on MODSSL_HAVE_ENGINE_API, or return ENOTIMPL.

* ssl_util.c(modssl_is_engine_id):
  No engine supported unless MODSSL_HAVE_ENGINE_API.

* ssl_util_ssl.c(modssl_dh_pkey_from_file, modssl_ec_group_from_file):
  Compat with openssl >= 3.0.
  


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1908537 13f79535-47bb-0310-9956-ffa450edef68
2023-03-19 21:30:47 +00:00
Yann Ylavic
6044859057 core: Efficient ap_thread_current() when apr_thread_local() is missing.
#define ap_thread_create, ap_thread_current_create and ap_thread_current to
their apr-1.8+ equivalent if available, or implement them using the compiler's
thread_local mechanism if available, or finally provide stubs otherwise.

#define AP_HAS_THREAD_LOCAL to 1 in the two former case or 0 otherwise, while
AP_THREAD_LOCAL is defined to the compiler's keyword iff AP_HAS_THREAD_LOCAL.

Replace all apr_thread_create() calls with ap_thread_create() so that httpd
threads can use ap_thread_current()'s pool data as Thread Local Storage.

Bump MMN minor.

* include/httpd.h():
  Define AP_HAS_THREAD_LOCAL, AP_THREAD_LOCAL (eventually), ap_thread_create(),
  ap_thread_current_create() and ap_thread_current().
  
* server/util.c:
  Implement ap_thread_create(), ap_thread_current_create() and
  ap_thread_current() when APR < 1.8.

* modules/core/mod_watchdog.c, modules/http2/h2_workers.c,
    modules/ssl/mod_ssl_ct.c:
  Use ap_thread_create() instead of apr_thread_create.

* server/main.c:
  Use AP_HAS_THREAD_LOCAL and ap_thread_current_create instead of APR's.

* server/util_pcre.c:
  Use AP_HAS_THREAD_LOCAL and ap_thread_current instead of APR's.

* server/mpm/event/event.c, server/mpm/worker/worker.c,
    server/mpm/prefork/prefork.c:
  Use ap_thread_create() instead of apr_thread_create.
  Create an apr_thread_t/ap_thread_current() for the main chaild thread usable
  at child_init().
  
* server/mpm/winnt/child.c:
  Use ap_thread_create() instead of CreateThread().
  Create an apr_thread_t/ap_thread_current() for the main chaild thread usable



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897460 13f79535-47bb-0310-9956-ffa450edef68
2022-01-25 17:34:57 +00:00
Christophe Jaillet
78d9aee916 Follow-up to r1896361.
Use a cleaner solution.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1896817 13f79535-47bb-0310-9956-ffa450edef68
2022-01-07 17:30:48 +00:00
Christophe Jaillet
442b4b167f Close a file handle in case of error in ct_static_scts()
PR 65760 <ryancaicse gmail.com>

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1896361 13f79535-47bb-0310-9956-ffa450edef68
2021-12-24 13:49:35 +00:00
Yann Ylavic
adb6b3ce7d mod_ssl_ct: join the threads before their parent pools are destroyed.
This can happen on stop/restart for the daeomon thread, or on clean_child_exit()
for the service thread.

When an apr_thread_create()d thread exits it destroys its pool (in any case),
either explicitely when apr_thread_exit() is called, or implicitely after the
function returns (only in APR 2.0 for now).

So we should make sure that mod_ssl_ct's daemon and service threads exit before
pconf and pchild (the parent pools, respectively) destroy their children pools,
otherwise the threads' pool will be destroyed twice and cause a crash.

Using a pre_cleanup to wait for the threads avoids this.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1883667 13f79535-47bb-0310-9956-ffa450edef68
2020-11-20 16:31:21 +00:00
Yann Ylavic
f461bcf12c Add missing pool tags to help debugging.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1876599 13f79535-47bb-0310-9956-ffa450edef68
2020-04-16 12:32:33 +00:00
Mike Rumph
85760859ca Fix spelling errors found by codespell. [skip ci]
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1873985 13f79535-47bb-0310-9956-ffa450edef68
2020-02-13 18:15:57 +00:00
Christophe Jaillet
3e56c5b221 Fix some typos reported in PR 59998
Most add already been fixed when PR 59990 had been applied on trunk. 

Thx klemens

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1827669 13f79535-47bb-0310-9956-ffa450edef68
2018-03-24 20:05:19 +00:00
Jacob Champion
6f10517a08 mod_ssl_ct: fix return values for custom extension callback
This is most likely a follow-up to r1628833.

At some point during the OpenSSL 1.0.2 beta, the contract for custom
extension callbacks changed from "returning -1 skips the extension" to
"returning -1 will issue a TLS fatal alert". This caused mod_ssl_ct to
abort TLS connections that it intended to ignore. Zero is the correct
return value for "do nothing" in 1.0.2.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1791845 13f79535-47bb-0310-9956-ffa450edef68
2017-04-19 01:32:58 +00:00
Jeff Trawick
23ce448f33 Check for proxy_detach_backend hook, for 2.4.x compatibility
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1735949 13f79535-47bb-0310-9956-ffa450edef68
2016-03-21 11:45:44 +00:00
Jeff Trawick
be470badcc Don't check for presence of ap_log_cdata/ap_log_data
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1735809 13f79535-47bb-0310-9956-ffa450edef68
2016-03-19 20:41:31 +00:00
Christophe Jaillet
7ee83c7e5c Save a few bytes in conf pool when parsing some directives on some OS.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1732368 13f79535-47bb-0310-9956-ffa450edef68
2016-02-25 20:58:20 +00:00
Rainer Jung
d7639a5ad0 Support OpenSSL 1.1.0.
- use common code for OpenSSL pre-1.1.0 and
  1.1.0 where possible.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1730422 13f79535-47bb-0310-9956-ffa450edef68
2016-02-14 22:40:07 +00:00
Rainer Jung
8bc4871c57 Support for OpenSSL 1.1.0:
- mod_ssl
Look out for "XXX: OpenSSL 1.1.0:" for a few
open problems.

Not tested with test suite yet.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1728909 13f79535-47bb-0310-9956-ffa450edef68
2016-02-07 01:20:37 +00:00
Rainer Jung
af14d158a3 Added many log numbers to log statements that
had none.

Those were not detected by the coccinelle script.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1725485 13f79535-47bb-0310-9956-ffa450edef68
2016-01-19 12:02:41 +00:00
Rainer Jung
322f418ecc Silence compiler warning:
'cached' may be used uninitialized in this function


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1725480 13f79535-47bb-0310-9956-ffa450edef68
2016-01-19 11:48:15 +00:00
Rainer Jung
44ce30494e Added many log numbers to log statements that
had none.

Handled all files in modules/.

I used the coccinelle script provided by Stefan.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1725392 13f79535-47bb-0310-9956-ffa450edef68
2016-01-19 00:03:18 +00:00
Jeff Trawick
f429b5a940 mod_ssl_ct needs a per-vhost module config even if a vhost
doesn't contain mod_ssl_ct's own directives, because the
module config needs to represent that vhost's certificates.

PR: 57533


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1661540 13f79535-47bb-0310-9956-ffa450edef68
2015-02-22 20:12:26 +00:00
Jeff Trawick
6830babddd Provide separate SSL_CT_*_STATUS variables for client vs. proxy
connections, courtesy of a new flag passed from mod_ssl on its
pre_connection "optional hook."


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1661487 13f79535-47bb-0310-9956-ffa450edef68
2015-02-22 15:50:54 +00:00
Jeff Trawick
c5062591f9 Fix extraction of an SCT list from a stapled OCSP response.
The hard-coded 2 byte offset to get to the list (in lieu of
the proper logic) didn't survive the addition of the SCT
from an additional log.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1645546 13f79535-47bb-0310-9956-ffa450edef68
2014-12-15 01:37:40 +00:00
Christophe Jaillet
a3ca028f70 Style ('{' on same line as function definition)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1631021 13f79535-47bb-0310-9956-ffa450edef68
2014-10-11 05:47:02 +00:00
Jeff Trawick
c478a4da6f mod_ssl_ct: Work with current Certificate Transparency tools
(e.g., as of certificate-transparency commit 
3f03188fe89974d45345fddee64a8227bd2ec26a)

The interface to the "ct" tool now requires the log's URL and
public key, resulting in a bit of refactoring in the module.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1630624 13f79535-47bb-0310-9956-ffa450edef68
2014-10-10 00:16:05 +00:00
Jeff Trawick
8cf87ccbf7 Adjust Certificate Transparency support (mod_ssl_ct) to build with/require OpenSSL 1.0.2 Beta 3.
Update notes on missing OpenSSL documentation.

Submitted by: ben (the primary changes), trawick


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1628833 13f79535-47bb-0310-9956-ffa450edef68
2014-10-01 20:54:04 +00:00
Jeff Trawick
dca1da20e3 Add message numbers to mod_ssl_ct messages with severity > debug.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1612122 13f79535-47bb-0310-9956-ffa450edef68
2014-07-20 17:08:20 +00:00
Jeff Trawick
2d53bf18ca APR_THREAD_FUNC decorator needed for 32-bit builds on Windows
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1606337 13f79535-47bb-0310-9956-ffa450edef68
2014-06-28 12:55:08 +00:00
Christophe Jaillet
2d01df12ea Fix duplicate APLOGNO
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1596108 13f79535-47bb-0310-9956-ffa450edef68
2014-05-20 04:02:49 +00:00
Jeff Trawick
4921c237ba allow operation without any logs configured or without the
log client tool configured

this supports configurations where SCTs are managed by the admin or
by some other infrastructure


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1589398 13f79535-47bb-0310-9956-ffa450edef68
2014-04-23 12:45:45 +00:00
Jeff Trawick
d4515e5187 ensure that the post-config hook runs after that of mod_ssl
(mod_ssl_ct looks for stuff that should have been found
while mod_ssl ran)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1589389 13f79535-47bb-0310-9956-ffa450edef68
2014-04-23 12:38:03 +00:00
Jeff Trawick
c51e4d9cbc Add module mod_ssl_ct, which provides an implementation of Certificate
Transparency (RFC 6962) for httpd.

mod_ssl_ct requires OpenSSL 1.0.2 (in beta) and must be explicitly
enabled via configure.

Note that support/ctauditscts is purposefully not installed; it
does not properly function due to a dependency on a 
certificate-transparency open source project tool which itself is
not sufficiently complete at this time.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1588987 13f79535-47bb-0310-9956-ffa450edef68
2014-04-21 21:14:21 +00:00