added CMake support for new Apple native certificate verification

This commit is contained in:
Brett
2023-10-17 13:12:37 -06:00
parent 0244c2a254
commit a1d76849e6

View File

@@ -1721,21 +1721,23 @@ if(WOLFSSL_SYS_CA_CERTS)
override_cache(WOLFSSL_SYS_CA_CERTS "no") override_cache(WOLFSSL_SYS_CA_CERTS "no")
elseif(APPLE) elseif(APPLE)
check_include_file("Security/SecTrustSettings.h" HAVE_SECURITY_SECTRUSTSETTINGS_H) check_include_file("Security/SecTrustSettings.h" HAVE_SECURITY_SECTRUSTSETTINGS_H)
if(NOT HAVE_SECURITY_SECTRUSTSETTINGS_H) check_include_file("Security/SecCertificate.h" HAVE_SECURITY_SECCERTIFICATE_H)
message("Can't enable system CA certs without Security/SecTrustSettings.h.") check_include_file("Security/SecTrust.h" HAVE_SECURITY_SECTRUST_H)
override_cache(WOLFSSL_SYS_CA_CERTS "no") check_include_file("Security/SecPolicy.h" HAVE_SECURITY_SECPOLICY_H)
else() if(HAVE_SECURITY_SECTRUSTSETTINGS_H OR (HAVE_SECURITY_SECCERTIFICATE_H
AND HAVE_SECURITY_SECTRUST_H
AND HAVE_SECURITY_SECPOLICY_H))
find_library(CORE_FOUNDATION_FRAMEWORK CoreFoundation) find_library(CORE_FOUNDATION_FRAMEWORK CoreFoundation)
if(NOT CORE_FOUNDATION_FRAMEWORK) if(NOT CORE_FOUNDATION_FRAMEWORK)
message("Can't enable system CA certs without CoreFoundation framework.") message(FATAL_ERROR "Can't enable system CA certs without CoreFoundation framework.")
override_cache(WOLFSSL_SYS_CA_CERTS "no")
else() else()
find_library(SECURITY_FRAMEWORK Security) find_library(SECURITY_FRAMEWORK Security)
if(NOT SECURITY_FRAMEWORK) if(NOT SECURITY_FRAMEWORK)
message("Can't enable system CA certs without Security framework.") message(FATAL_ERROR "Can't enable system CA certs without Security framework.")
override_cache(WOLFSSL_SYS_CA_CERTS "no")
endif() endif()
endif() endif()
else()
message(FATAL_ERROR "Can't enable system CA certs without Apple Security.framework headers.")
endif() endif()
endif() endif()