]> git.feebdaed.xyz Git - 0xmirror/curl.git/commitdiff
openssl: drop includes unused or duplicate
authorViktor Szakats <commit@vsz.me>
Sat, 20 Dec 2025 11:38:19 +0000 (12:38 +0100)
committerViktor Szakats <commit@vsz.me>
Sat, 20 Dec 2025 12:51:05 +0000 (13:51 +0100)
Also:
- vquic-tls.h: do not include unused headers for non-H3 builds.
- autotools: stop looking for `openssl/x509.h` header.
- cmp-config.pl: delete exception for `openssl/x509.h`.
- examples: format/comment sync between the two touched files.
- openssl: drop unused `curlx/wait.h` include.

Closes #20049

.github/scripts/cmp-config.pl
docs/examples/cacertinmem.c
docs/examples/usercertinmem.c
lib/vquic/vquic-tls.h
lib/vtls/openssl.c
lib/vtls/schannel.h
m4/curl-amissl.m4
m4/curl-openssl.m4
tests/libtest/lib758.c

index a74389637f16949adfc123a14badb830c6a93ddf..e831a97211a548f582050beec313a003419f6fbd 100755 (executable)
@@ -68,7 +68,6 @@ my %remove = (
     '#define HAVE_OPENSSL_PEM_H 1' => 1,
     '#define HAVE_OPENSSL_RSA_H 1' => 1,
     '#define HAVE_OPENSSL_SSL_H 1' => 1,
-    '#define HAVE_OPENSSL_X509_H 1' => 1,
     '#define HAVE_QUICHE_H 1' => 1,
     '#define HAVE_SSL_SET_QUIC_TLS_CBS 1' => 1,
     '#define HAVE_SSL_SET_QUIC_USE_LEGACY_CODEPOINT 1' => 1,
index 786ae00d5a192599d94daab6eeaa8946c25cc492..2ede090a26bde192a27a748ad1c32532d0a6f000 100644 (file)
@@ -28,7 +28,6 @@
 
 /* Requires: USE_OPENSSL */
 
-#include <openssl/err.h>
 #include <openssl/ssl.h>
 
 #include <stdio.h>
index 8f50e75d6d4b6051f6a1827c9571fd59ed38954d..6c782647c7de6752005c8d9b1632d95ed97c0dde 100644 (file)
@@ -38,9 +38,9 @@
 #endif
 
 #include <openssl/ssl.h>
-#include <openssl/x509.h>
-#include <openssl/pem.h>
+
 #include <curl/curl.h>
+
 #include <stdio.h>
 
 #if defined(__GNUC__) || defined(__clang__)
@@ -189,7 +189,7 @@ int main(void)
     else
       printf("*** transfer failed ***\n");
 
-    /* second try: retrieve page using user certificate and key -> succeeds
+    /* second try: retrieve page using user certificate and key -> succeeds to
      * load the certificate and key by installing a function doing
      * the necessary "modifications" to the SSL CONTEXT just before link init
      */
index 7bddb42c99f322aedf0907cb147cc90a6c6195a8..a14714532d03531fd95c5a9789a7c367ad93edfd 100644 (file)
  ***************************************************************************/
 
 #include "../curl_setup.h"
-#include "../bufq.h"
-#include "../vtls/vtls.h"
-#include "../vtls/vtls_int.h"
-#include "../vtls/openssl.h"
 
 #if defined(USE_HTTP3) && \
   (defined(USE_OPENSSL) || defined(USE_GNUTLS) || defined(USE_WOLFSSL))
 
+#include "../bufq.h"
+#include "../vtls/vtls.h"
+#include "../vtls/vtls_int.h"
+
+#include "../vtls/openssl.h"
 #include "../vtls/wolfssl.h"
 
 struct ssl_peer;
index e0a97ac121e6ea39cb2a92a97544560ab83be13e..02cc49a39b22750b886515fe70cad9a53a7075b4 100644 (file)
@@ -52,7 +52,6 @@
 #include "../connect.h"
 #include "../progress.h"
 #include "../select.h"
-#include "../curlx/wait.h"
 #include "vtls.h"
 #include "vtls_int.h"
 #include "vtls_scache.h"
@@ -66,7 +65,6 @@
 #include "../strdup.h"
 #include "apple.h"
 
-#include <openssl/ssl.h>
 #include <openssl/rand.h>
 #include <openssl/x509v3.h>
 #ifndef OPENSSL_NO_DSA
 #endif
 #include <openssl/dh.h>
 #include <openssl/err.h>
-#include <openssl/md5.h>
 #include <openssl/conf.h>
 #include <openssl/bn.h>
 #include <openssl/rsa.h>
 #include <openssl/bio.h>
-#include <openssl/buffer.h>
 #include <openssl/pkcs12.h>
 #include <openssl/tls1.h>
 #include <openssl/evp.h>
index 47017c5f56862b673a2f999413fe8cbc37bd3dbf..f66bcf29333808f362667cb763071fab9037aafe 100644 (file)
@@ -58,7 +58,7 @@
 /* <wincrypt.h> has been included via the above <schnlsp.h>.
  * Or in case of ldap.c, it was included via <winldap.h>.
  * And since <wincrypt.h> has this:
- *   #define X509_NAME  ((LPCSTR) 7)
+ *   #define X509_NAME  ((LPCSTR)7)
  *
  * And in BoringSSL's <openssl/base.h> there is:
  *  typedef struct X509_name_st X509_NAME;
index a1c2d3979cbd52c5579520cec221288d00681305..aa3e3af37521e2253acb47eec5671215d2510585 100644 (file)
@@ -52,8 +52,7 @@ if test "$HAVE_PROTO_BSDSOCKET_H" = "1"; then
       CURL_NETWORK_AND_TIME_LIBS="-lamisslstubs -lamisslauto $CURL_NETWORK_AND_TIME_LIBS"
       AC_DEFINE(USE_AMISSL, 1, [if AmiSSL is in use])
       AC_DEFINE(USE_OPENSSL, 1, [if OpenSSL is in use])
-      AC_CHECK_HEADERS(openssl/x509.h openssl/rsa.h openssl/crypto.h \
-                       openssl/pem.h openssl/ssl.h openssl/err.h)
+      AC_CHECK_HEADERS(openssl/rsa.h openssl/crypto.h openssl/pem.h openssl/ssl.h openssl/err.h)
     ],[
       AC_MSG_RESULT([no])
     ])
index 3892e0e89f024feb99d2e4c75b51bb237018f6c5..be30c2c01be40c289ec87729ca0a9d9e5641050a 100644 (file)
@@ -211,8 +211,7 @@ if test "x$OPT_OPENSSL" != "xno"; then
 
     if test "$ac_cv_lib_ssl_SSL_connect" = "yes"; then
       dnl Have the libraries--check for OpenSSL headers
-      AC_CHECK_HEADERS(openssl/x509.h openssl/rsa.h openssl/crypto.h \
-                       openssl/pem.h openssl/ssl.h openssl/err.h,
+      AC_CHECK_HEADERS(openssl/rsa.h openssl/crypto.h openssl/pem.h openssl/ssl.h openssl/err.h,
         ssl_msg="OpenSSL"
         test "openssl" != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes
         OPENSSL_ENABLED=1
index 9fcdaad2a05f3bba59da442aa5c6ffb723670e45..12f476e9c72dba88bc08eb52a0b92e0f42c44f18 100644 (file)
@@ -34,7 +34,6 @@
 
 #ifdef USE_OPENSSL
 
-#include <openssl/x509.h>
 #include <openssl/ssl.h>
 
 #if OPENSSL_VERSION_NUMBER >= 0x30000000L