From 6cdaa4aee832862ce37de133f919c8df88927320 Mon Sep 17 00:00:00 2001 From: Witold Filipczyk Date: Tue, 19 Nov 2024 13:55:21 +0100 Subject: [PATCH] [ssl] Hide warnings related to lack of inet_pton --- src/network/ssl/socket.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/network/ssl/socket.c b/src/network/ssl/socket.c index eca7ed3df..fd030d1e9 100644 --- a/src/network/ssl/socket.c +++ b/src/network/ssl/socket.c @@ -260,6 +260,7 @@ static int match_uri_host_ip(const char *uri_host, ASN1_OCTET_STRING *cert_host_asn1) { +#if defined(HAVE_INET_PTON) || defined(HAVE_INET_ATON) #ifdef HAVE_ASN1_STRING_GET0_DATA const unsigned char *cert_host_addr = ASN1_STRING_get0_data(cert_host_asn1); #else @@ -267,10 +268,11 @@ match_uri_host_ip(const char *uri_host, #endif struct in_addr uri_host_in; +#ifdef HAVE_INET_PTON #ifdef CONFIG_IPV6 struct in6_addr uri_host_in6; #endif - +#endif /* RFC 5280 defines the iPAddress alternative of GeneralName * as an OCTET STRING. Verify that the type is indeed that. * This is an assertion because, if someone puts the wrong @@ -311,6 +313,9 @@ match_uri_host_ip(const char *uri_host, default: return 0; } +#else + return 0; +#endif } /** Verify one certificate in the server certificate chain.