2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-08-22 01:49:11 +00:00

Move compat definition of ASN1_STRING_get0_data to hostcheck.c.

It is not used anywhere else.
This commit is contained in:
Todd C. Miller 2023-08-06 14:26:24 -06:00
parent fc7bfd5046
commit e5f2354c85
2 changed files with 5 additions and 8 deletions

View File

@ -21,13 +21,6 @@
# include <openssl/x509v3.h>
/*
* 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,

View File

@ -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);