1 diff -ru gnutls-old/lib/Makefile.am gnutls/lib/Makefile.am
2 --- gnutls-old/lib/Makefile.am 2013-06-02 19:33:57.000000000 +0200
3 +++ gnutls/lib/Makefile.am 2013-11-10 13:28:18.000000000 +0100
5 DISTCLEANFILES += $(defexec_DATA)
9 +libgnutls_la_LDFLAGS += -Wl,-framework,Security,-framework,CoreFoundation
13 thirdparty_libadd += -lcrypt32
15 diff -ru gnutls-old/lib/system.c gnutls/lib/system.c
16 --- gnutls-old/lib/system.c 2013-04-10 22:25:51.000000000 +0200
17 +++ gnutls/lib/system.c 2013-11-10 13:30:31.000000000 +0100
23 +#include "TargetConditionals.h"
26 +#include <Security/Security.h>
27 +#include <Security/SecCertificate.h>
31 /* System specific function wrappers.
38 +#elif defined(__APPLE__)
41 +int add_system_trust(gnutls_x509_trust_list_t list, unsigned int tl_flags, unsigned int tl_vflags)
45 + if (SecTrustCopyAnchorCertificates(&anchors) != 0)
48 + CFIndex count = CFArrayGetCount(anchors);
49 + for (int i = 0; i < count; i++) {
50 + SecCertificateRef certref = (SecCertificateRef)CFArrayGetValueAtIndex(anchors, i);
53 + SecCertificateGetData(certref, &certData);
54 + gnutls_datum data = {
55 + .data = certData.Data,
56 + .size = certData.Length,
59 + if (!gnutls_x509_trust_list_add_trust_mem(list, &data, NULL, GNUTLS_X509_FMT_DER, tl_flags, tl_vflags))
60 + printf("cannot add x509 credentials\n");
70 +#define add_system_trust(x,y,z) GNUTLS_E_UNIMPLEMENTED_FEATURE
74 #define add_system_trust(x,y,z) GNUTLS_E_UNIMPLEMENTED_FEATURE