[gnome-keyring/trust-store] Find the root certificates by default.



commit 4b45a2761cd8602cc601df728f18064cab0adf18
Author: Stef Walter <stefw collabora co uk>
Date:   Thu Dec 9 22:26:14 2010 +0000

    Find the root certificates by default.
    
    We need to have a good set of root anchor certificates. So look for them
    in configure by default. This can be disabled with --without-root-certs
    or fine tuned with --with-root-certs=/path/to/certs

 configure.in |   36 ++++++++++++++++++++++++++----------
 1 files changed, 26 insertions(+), 10 deletions(-)
---
diff --git a/configure.in b/configure.in
index d5b89f0..e9b3cd1 100644
--- a/configure.in
+++ b/configure.in
@@ -369,18 +369,34 @@ AM_CONDITIONAL(WITH_GPG, test "$enable_gpg_agent" != "no")
 # Trusted Root Certificates Directory
 #
 
-AC_ARG_WITH([root-certs],
-            [AC_HELP_STRING([--with-root-certs=DIR],
-                            [directory with trusted root certificates])])
-
-root_status="none"
-if test -n "$with_root_certs"; then
-	AC_DEFINE_UNQUOTED(ROOT_CERTIFICATES, "$with_root_certs", [Directory for trusted root certificates])
-	root_status="$with_root_certs"
-fi
+AC_MSG_CHECKING([location of system Certificate Authority list])
+AC_ARG_WITH(root-certs,
+		[AC_HELP_STRING([--with-root-certs=@<:@path@:>@],
+			[path to system Certificate Authority list])])
+if test "$with_root_certs" = "no"; then
+	AC_MSG_RESULT([disabled])
+	root_status="none"
+	with_root_certs="no"
+else
+	if test -z "$with_root_certs"; then
+		for f in /etc/pki/tls/certs /etc/ssl/certs; do
+			if test -d "$f"; then
+				with_root_certs="$f"
+			fi
+		done
+		if test -z "$with_root_certs"; then
+			AC_MSG_ERROR([could not find. Use --with-root-certs=path to set, or --without-root-certs to disable])
+		fi
+	fi
 
-AM_CONDITIONAL(WITH_ROOT_CERTS, test -n "$with_root_certs")
+	AC_MSG_RESULT($with_root_certs)
+	if ! test -d "$with_root_certs"; then
+		AC_MSG_ERROR([No such directory '$with_root_certs'. Use --with-root-certs=path to set, or --without-root-certs to disable])
+	fi
 
+	root_status="yes ($with_root_certs)"
+	AC_DEFINE_UNQUOTED([ROOT_CERTIFICATES], ["$with_root_certs"], [path to system Certificate Authority list])
+fi
 
 # --------------------------------------------------------------------
 # Check for /dev/random



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]