1 commit 9bcdde1ab9cdff6a4471f9a926dd488ab70c7247
2 Author: Daiderd Jordan <daiderd@gmail.com>
3 Date: Mon Apr 22 16:38:27 2019 +0200
5 Revert "gnutls_x509_trust_list_add_system_trust: Add macOS keychain support"
7 This reverts commit c0eb46d3463cd21b3f822ac377ff37f067f66b8d.
9 diff --git a/configure.ac b/configure.ac
10 index 8ad597bfd..8d14f26cd 100644
13 @@ -781,7 +781,7 @@ dnl auto detect https://lists.gnu.org/archive/html/help-gnutls/2012-05/msg00004.
14 AC_ARG_WITH([default-trust-store-file],
15 [AS_HELP_STRING([--with-default-trust-store-file=FILE],
16 [use the given file default trust store])], with_default_trust_store_file="$withval",
17 - [if test "$build" = "$host" && test x$with_default_trust_store_pkcs11 = x && test x$with_default_trust_store_dir = x && test x$have_macosx = x;then
18 + [if test "$build" = "$host" && test x$with_default_trust_store_pkcs11 = x && test x$with_default_trust_store_dir = x;then
20 /etc/ssl/ca-bundle.pem \
21 /etc/ssl/certs/ca-certificates.crt \
22 diff --git a/lib/Makefile.am b/lib/Makefile.am
23 index fe9cf63a2..745695f7e 100644
26 @@ -203,10 +203,6 @@ if WINDOWS
27 thirdparty_libadd += -lcrypt32
31 -libgnutls_la_LDFLAGS += -framework Security -framework CoreFoundation
34 libgnutls_la_LIBADD += $(thirdparty_libadd)
37 diff --git a/lib/system/certs.c b/lib/system/certs.c
38 index 611c645e0..912b0aa5e 100644
39 --- a/lib/system/certs.c
40 +++ b/lib/system/certs.c
46 -# include <CoreFoundation/CoreFoundation.h>
47 -# include <Security/Security.h>
48 -# include <Availability.h>
51 /* System specific function wrappers for certificate stores.
54 @@ -276,72 +270,6 @@ int add_system_trust(gnutls_x509_trust_list_t list, unsigned int tl_flags,
58 -#elif defined(__APPLE__) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
60 -int osstatus_error(status)
62 - CFStringRef err_str = SecCopyErrorMessageString(status, NULL);
63 - _gnutls_debug_log("Error loading system root certificates: %s\n",
64 - CFStringGetCStringPtr(err_str, kCFStringEncodingUTF8));
66 - return GNUTLS_E_FILE_ERROR;
70 -int add_system_trust(gnutls_x509_trust_list_t list, unsigned int tl_flags,
71 - unsigned int tl_vflags)
75 - SecTrustSettingsDomain domain[] = { kSecTrustSettingsDomainUser,
76 - kSecTrustSettingsDomainAdmin,
77 - kSecTrustSettingsDomainSystem };
78 - for (size_t d=0; d<sizeof(domain)/sizeof(*domain); d++) {
79 - CFArrayRef certs = NULL;
80 - OSStatus status = SecTrustSettingsCopyCertificates(domain[d],
82 - if (status == errSecNoTrustSettings)
84 - if (status != errSecSuccess)
85 - return osstatus_error(status);
87 - int cert_count = CFArrayGetCount(certs);
88 - for (int i=0; i<cert_count; i++) {
89 - SecCertificateRef cert =
90 - (void*)CFArrayGetValueAtIndex(certs, i);
92 - status = SecItemExport(cert, kSecFormatX509Cert, 0,
94 - if (status != errSecSuccess) {
97 - return osstatus_error(status);
100 - if (gnutls_x509_trust_list_add_trust_mem(list,
101 - &(gnutls_datum_t) {
102 - .data = (void*)CFDataGetBytePtr(der),
103 - .size = CFDataGetLength(der),
106 - GNUTLS_X509_FMT_DER,
115 -#ifdef DEFAULT_BLACKLIST_FILE
116 - ret = gnutls_x509_trust_list_remove_trust_file(list, DEFAULT_BLACKLIST_FILE, GNUTLS_X509_FMT_PEM);
118 - _gnutls_debug_log("Could not load blacklist file '%s'\n", DEFAULT_BLACKLIST_FILE);
126 #define add_system_trust(x,y,z) GNUTLS_E_UNIMPLEMENTED_FEATURE