diff --git a/include/hostcheck.h b/include/hostcheck.h index ed5a97386..5c05d3605 100644 --- a/include/hostcheck.h +++ b/include/hostcheck.h @@ -21,13 +21,6 @@ # include -/* - * Compatibility defines for OpenSSL 1.0.2 (not needed for 1.1.x) - */ -# if !defined(HAVE_ASN1_STRING_GET0_DATA) && !defined(HAVE_WOLFSSL) -# define ASN1_STRING_get0_data(x) ASN1_STRING_data(x) -# endif /* !HAVE_ASN1_STRING_GET0_DATA && !HAVE_WOLFSSL */ - typedef enum { MatchFound, MatchNotFound, diff --git a/lib/iolog/hostcheck.c b/lib/iolog/hostcheck.c index 9212c592d..62ab7601d 100644 --- a/lib/iolog/hostcheck.c +++ b/lib/iolog/hostcheck.c @@ -47,6 +47,10 @@ # define INET6_ADDRSTRLEN 46 #endif +#if !defined(HAVE_ASN1_STRING_GET0_DATA) && !defined(HAVE_WOLFSSL) +# define ASN1_STRING_get0_data(x) ASN1_STRING_data(x) +#endif /* !HAVE_ASN1_STRING_GET0_DATA && !HAVE_WOLFSSL */ + /** * @brief Checks if given hostname resolves to the given IP address. * @@ -129,7 +133,7 @@ exit: static HostnameValidationResult validate_name(const char *hostname, ASN1_STRING *certname_asn1) { - char *certname_s = (char *) ASN1_STRING_get0_data(certname_asn1); + char *certname_s = (char *)ASN1_STRING_get0_data(certname_asn1); size_t certname_len = (size_t)ASN1_STRING_length(certname_asn1); size_t hostname_len = strlen(hostname); debug_decl(validate_name, SUDO_DEBUG_UTIL);