File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -396,9 +396,12 @@ AC_LANG_POP(C)
396396if test $has_function = 1; then
397397 AC_MSG_RESULT ( [ yes] )
398398 AC_DEFINE ( [ HAS_X509_check_host] , [ ] , [ Define if ssl library has X509_check_host] )
399+ OPENSSL_HOSTNAME_VALIDATION_OBJ=""
399400else
400401 AC_MSG_RESULT ( [ no] )
402+ OPENSSL_HOSTNAME_VALIDATION_OBJ="openssl_hostname_validation.o"
401403fi
404+ AC_SUBST ( OPENSSL_HOSTNAME_VALIDATION_OBJ )
402405] )
403406
404407dnl For geoip-api-c
Original file line number Diff line number Diff line change @@ -675,6 +675,7 @@ PCRE2_CFLAGS
675675PKG_CONFIG_LIBDIR
676676PKG_CONFIG_PATH
677677PKG_CONFIG
678+ OPENSSL_HOSTNAME_VALIDATION_OBJ
678679LDFLAGS_PRIVATELIBS
679680CONTROLFILE
680681PIDFILE
@@ -8251,11 +8252,14 @@ printf "%s\n" "yes" >&6; }
82518252
82528253printf " %s\n" " #define HAS_X509_check_host /**/" >> confdefs.h
82538254
8255+ OPENSSL_HOSTNAME_VALIDATION_OBJ=" "
82548256else
82558257 { printf " %s\n" " $as_me :${as_lineno-$LINENO } : result: no" >&5
82568258printf " %s\n" " no" >&6 ; }
8259+ OPENSSL_HOSTNAME_VALIDATION_OBJ=" openssl_hostname_validation.o"
82578260fi
82588261
8262+
82598263# Check whether --enable-dynamic-linking was given.
82608264if test ${enable_dynamic_linking+y}
82618265then :
Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ OBJS=ircd_vars.o dns.o auth.o channel.o dbuf.o \
3333 api-event.o api-rpc.o api-apicallback.o \
3434 crypt_blowfish.o unrealdb.o crashreport.o modulemanager.o \
3535 utf8.o json.o log.o \
36- openssl_hostname_validation.o $(URL )
36+ @OPENSSL_HOSTNAME_VALIDATION_OBJ@ $(URL )
3737
3838SRC=$(OBJS:%.o =%.c)
3939
Original file line number Diff line number Diff line change @@ -287,8 +287,8 @@ SOFTWARE.
287287*/
288288static HostnameValidationResult matches_common_name (const char * hostname , const X509 * server_cert ) {
289289 int common_name_loc = -1 ;
290- X509_NAME_ENTRY * common_name_entry = NULL ;
291- ASN1_STRING * common_name_asn1 = NULL ;
290+ const X509_NAME_ENTRY * common_name_entry = NULL ;
291+ const ASN1_STRING * common_name_asn1 = NULL ;
292292 const char * common_name_str = NULL ;
293293
294294 // Find the position of the CN field in the Subject field of the certificate
Original file line number Diff line number Diff line change 2525#include "unrealircd.h"
2626#include "openssl_hostname_validation.h"
2727
28+ #if (OPENSSL_VERSION_NUMBER >= 0x10100000L ) && !defined(LIBRESSL_VERSION_NUMBER )
29+ #define OSSL_CONST const
30+ #else
31+ #define OSSL_CONST
32+ #endif
33+
2834#ifdef _WIN32
2935#define IDC_PASS 1166
3036extern HINSTANCE hInst ;
@@ -1342,7 +1348,7 @@ const char *certificate_name(SSL *ssl)
13421348{
13431349 static char buf [384 ];
13441350 X509 * cert ;
1345- X509_NAME * n ;
1351+ OSSL_CONST X509_NAME * n ;
13461352
13471353 if (!ssl )
13481354 return NULL ;
You can’t perform that action at this time.
0 commit comments