Skip to content
Snippets Groups Projects
Commit a4687704 authored by Kateryna Kostiuk's avatar Kateryna Kostiuk Committed by Kateryna Kostiuk
Browse files

gnutls: fix certificate loading on Darwin

Certificate loading failed when gnutls build with clang 12.
A possible workaround is to build libtasn1 with optimization O1
Also, this patch fixes the libtasn1 build compiled with O1.

Gitlab: #493
Change-Id: I698d8212801e2cc65661e64e7f5fee3eacbc7c5a
parent 7f3c1b35
Branches
No related tags found
No related merge requests found
From 2da87398f460ba2e671456dd5a88568b751d86bc Mon Sep 17 00:00:00 2001
From: kkostiuk <kateryna.kostiuk@savoirfairelinux.com>
Date: Sun, 28 Mar 2021 14:42:30 -0400
Subject: [PATCH] use system isdigit
---
lib/minitasn1/parser_aux.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/lib/minitasn1/parser_aux.c b/lib/minitasn1/parser_aux.c
index d5dbbf8..ac1db6f 100644
--- a/lib/minitasn1/parser_aux.c
+++ b/lib/minitasn1/parser_aux.c
@@ -26,7 +26,9 @@
#include "gstr.h"
#include "structure.h"
#include "element.h"
-#include "c-ctype.h"
+#include "ctype.h"
+#undef c_isdigit
+#define c_isdigit isdigit
char _asn1_identifierMissing[ASN1_MAX_NAME_SIZE + 1]; /* identifier name not found */
--
2.24.3 (Apple Git-128)
......@@ -25,6 +25,9 @@ endif
ifdef HAVE_ANDROID
$(APPLY) $(SRC)/gnutls/no-create-time-h.patch
endif
ifdef HAVE_DARWIN_OS
$(APPLY) $(SRC)/gnutls/0001-use-system-isdigit.patch
endif
ifdef HAVE_MACOSX
$(APPLY) $(SRC)/gnutls/gnutls-disable-getentropy-osx.patch
endif
......@@ -70,11 +73,13 @@ endif
ifdef HAVE_ANDROID
cd $< && $(HOSTVARS) gl_cv_header_working_stdint_h=yes ./configure $(GNUTLS_CONF)
else
#use O1 to compile gnutls on darwin platforms. It is a workaround to fix
#libtasn1 certificate loading https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=252548
ifdef HAVE_IOS
cd $< && $(HOSTVARS) ac_cv_func_clock_gettime=no CFLAGS="$(CFLAGS)" ./configure $(GNUTLS_CONF)
cd $< && $(HOSTVARS) ac_cv_func_clock_gettime=no CFLAGS="$(CFLAGS) -O1" ./configure $(GNUTLS_CONF)
else
ifdef HAVE_MACOSX
cd $< && $(HOSTVARS) ac_cv_func_clock_gettime=no CFLAGS="$(CFLAGS)" ./configure $(GNUTLS_CONF)
cd $< && $(HOSTVARS) ac_cv_func_clock_gettime=no CFLAGS="$(CFLAGS) -O1" ./configure $(GNUTLS_CONF)
else
cd $< && $(HOSTVARS) CFLAGS="$(CFLAGS)" ./configure $(GNUTLS_CONF)
endif
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment