From 1efc24eece37784b83f02582490a71e0f6db3c38 Mon Sep 17 00:00:00 2001 From: Kazuho Oku Date: Thu, 21 Apr 2016 12:53:49 +0900 Subject: [PATCH 1/2] add include guard --- openssl/openssl_hostname_validation.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/openssl/openssl_hostname_validation.h b/openssl/openssl_hostname_validation.h index 483dae7..1e13b4c 100644 --- a/openssl/openssl_hostname_validation.h +++ b/openssl/openssl_hostname_validation.h @@ -9,7 +9,9 @@ * License: See LICENSE * */ - +#ifndef openssl_hostname_validation_h +#define openssl_hostname_validation_h + typedef enum { MatchFound, MatchNotFound, @@ -30,3 +32,5 @@ typedef enum { * Returns Error if there was an error. */ HostnameValidationResult validate_hostname(const char *hostname, const X509 *server_cert); + +#endif From 55e9e6fe647ca41f4d26e9eff557442332e7ad4b Mon Sep 17 00:00:00 2001 From: Kazuho Oku Date: Thu, 21 Apr 2016 12:57:43 +0900 Subject: [PATCH 2/2] provide `OPENSSL_HOSTNAME_VALIDATION_LINKAGE` for adjusting the scope of `validate_hostname` --- openssl/openssl_hostname_validation.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/openssl/openssl_hostname_validation.h b/openssl/openssl_hostname_validation.h index 1e13b4c..ca4b9be 100644 --- a/openssl/openssl_hostname_validation.h +++ b/openssl/openssl_hostname_validation.h @@ -12,6 +12,10 @@ #ifndef openssl_hostname_validation_h #define openssl_hostname_validation_h +#ifndef OPENSSL_HOSTNAME_VALIDATION_LINKAGE +#define OPENSSL_HOSTNAME_VALIDATION_LINKAGE extern +#endif + typedef enum { MatchFound, MatchNotFound, @@ -31,6 +35,6 @@ typedef enum { * Returns MalformedCertificate if any of the hostnames had a NUL character embedded in it. * Returns Error if there was an error. */ -HostnameValidationResult validate_hostname(const char *hostname, const X509 *server_cert); +OPENSSL_HOSTNAME_VALIDATION_LINKAGE HostnameValidationResult validate_hostname(const char *hostname, const X509 *server_cert); #endif