]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Rename cert_valid.pl helper to security_fake_crtv
authorAmos Jeffries <squid3@treenet.co.nz>
Thu, 28 Jan 2016 11:02:42 +0000 (00:02 +1300)
committerAmos Jeffries <squid3@treenet.co.nz>
Thu, 28 Jan 2016 11:02:42 +0000 (00:02 +1300)
Also, shuffles the helper to the src/security/ area and creates necessary
infrastructure for bundling other certificate verifier helpers.

configure.ac
helpers/Makefile.am
src/security/Makefile.am
src/security/certv/Makefile.am [moved from helpers/ssl/Makefile.am with 73% similarity]
src/security/certv/fake/Makefile.am [new file with mode: 0644]
src/security/certv/fake/required.m4 [new file with mode: 0755]
src/security/certv/fake/security_fake_crtv.pl.in [moved from helpers/ssl/cert_valid.pl with 98% similarity]
src/security/certv/modules.m4 [new file with mode: 0644]

index cbe1eda9e1244f48436500a7ed0ad2d5bc25a2c6..9e4cb28e7cb35d04307aebf9aef4dc32a49b3376 100644 (file)
@@ -2586,6 +2586,18 @@ AC_ARG_ENABLE(url-rewrite-helpers,
 ])
 m4_include([helpers/url_rewrite/modules.m4])
 
+dnl Select security helpers to build
+AC_ARG_ENABLE(security-certv-helpers,
+  AS_HELP_STRING([--enable-security-certv-helpers="list of helpers"],
+                 [This option selects which security certificate verify helpers
+                  to build and install as part of the normal build
+                  process. The default is to attempt the build of all possible
+                  helpers. Use --disable-security-certv-helpers to build none.
+                  For a list of available helpers see the
+                  src/security/certv/ directory.]),[
+])
+m4_include([src/security/certv/modules.m4])
+
 dnl Select storeid_rewrite helpers to build
 AC_ARG_ENABLE(storeid-rewrite-helpers,
   AS_HELP_STRING([--enable-storeid-rewrite-helpers="list of helpers"],
index ab53a7cf180f193e25c5ab1f7f4f7f2874e8bd74..671a75d0e00e2787c83d5ce4192df5a5e7616c51 100644 (file)
@@ -15,7 +15,6 @@ DIST_SUBDIRS = \
        negotiate_auth \
        ntlm_auth \
        url_rewrite \
-       ssl \
        storeid_rewrite
 
 SUBDIRS = \
@@ -30,8 +29,3 @@ SUBDIRS = \
 if ENABLE_AUTH_NTLM
 SUBDIRS += ntlm_auth
 endif
-
-if ENABLE_SSL
-SUBDIRS += ssl
-endif
-
index 17affaff1c6778e3f1fe0e007b484318e7dc7a4b..bc8a644d2501867218aa6ff62c367b4571fee8f0 100644 (file)
@@ -8,6 +8,8 @@
 include $(top_srcdir)/src/Common.am
 include $(top_srcdir)/src/TestHeaders.am
 
+SUBDIRS= certv
+
 noinst_LTLIBRARIES = libsecurity.la
 
 libsecurity_la_SOURCES= \
similarity index 73%
rename from helpers/ssl/Makefile.am
rename to src/security/certv/Makefile.am
index 1770c7341780a28f32f94d6c90ff1533f413ec0c..3f94cd87b4b495840bee69b2fb93b96c157d7f7a 100644 (file)
@@ -5,8 +5,6 @@
 ## Please see the COPYING and CONTRIBUTORS files for details.
 ##
 
-include $(top_srcdir)/src/Common.am
+DIST_SUBDIRS= fake
+SUBDIRS= $(SECURITY_CERTV_HELPERS)
 
-libexec_SCRIPTS = cert_valid.pl
-EXTRA_DIST= \
-       cert_valid.pl
diff --git a/src/security/certv/fake/Makefile.am b/src/security/certv/fake/Makefile.am
new file mode 100644 (file)
index 0000000..e379a9a
--- /dev/null
@@ -0,0 +1,27 @@
+## Copyright (C) 1996-2016 The Squid Software Foundation and contributors
+##
+## Squid software is distributed under GPLv2+ license and includes
+## contributions from numerous individuals and organizations.
+## Please see the COPYING and CONTRIBUTORS files for details.
+##
+
+include $(top_srcdir)/src/Common.am
+
+libexec_SCRIPTS = security_fake_crtv
+CLEANFILES += security_fake_crtv
+EXTRA_DIST= \
+       security_fake_crtv.pl.in \
+       required.m4
+
+security_fake_crtv: security_fake_crtv.pl.in
+       $(subst_perlshell)
+
+if ENABLE_POD2MAN_DOC
+man_MANS = security_fake_crtv.8
+CLEANFILES += security_fake_crtv.8
+EXTRA_DIST += security_fake_crtv.8
+
+security_fake_crtv.8: security_fake_crtv
+       pod2man --section=8 security_fake_crtv security_fake_crtv.8
+
+endif
diff --git a/src/security/certv/fake/required.m4 b/src/security/certv/fake/required.m4
new file mode 100755 (executable)
index 0000000..2048d7b
--- /dev/null
@@ -0,0 +1,14 @@
+## Copyright (C) 1996-2016 The Squid Software Foundation and contributors
+##
+## Squid software is distributed under GPLv2+ license and includes
+## contributions from numerous individuals and organizations.
+## Please see the COPYING and CONTRIBUTORS files for details.
+##
+
+if test "x$PERL" != "x"; then
+  BUILD_HELPER="fake"
+fi
+if test "x$POD2MAN" = "x"; then
+  AC_MSG_WARN([pod2man not found. security_fake_certv man(8) page will not be built])
+fi
+
similarity index 98%
rename from helpers/ssl/cert_valid.pl
rename to src/security/certv/fake/security_fake_crtv.pl.in
index e95a2aa2ad67b542e474f598fa63567d0935d2c0..f33a0c082b26169c4d9d1eb9fcdc1f4859f65967 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/perl -w
+#!@PERL@
 #
 # A dummy SSL certificate validator helper that
 # echos back all the SSL errors sent by Squid.
@@ -19,11 +19,11 @@ my $help = 0;
 
 =head1 NAME
 
-cert_valid.pl - A fake cert validation helper for Squid
+security_fake_crtv - A fake cert validation helper for Squid
 
 =head1 SYNOPSIS
 
-cert_valid.pl [-d | --debug] [-h | --help]
+security_fake_crtv [-d | --debug] [-h | --help]
 
 =over 8
 
diff --git a/src/security/certv/modules.m4 b/src/security/certv/modules.m4
new file mode 100644 (file)
index 0000000..ee36fe4
--- /dev/null
@@ -0,0 +1,53 @@
+## Copyright (C) 1996-2016 The Squid Software Foundation and contributors
+##
+## Squid software is distributed under GPLv2+ license and includes
+## contributions from numerous individuals and organizations.
+## Please see the COPYING and CONTRIBUTORS files for details.
+##
+
+# This file is supposed to run all the tests required to identify which
+# configured modules are able to be built in this environment
+
+# FIXME: de-duplicate $enable_security_certv_helpers list containing double entries.
+
+#define list of modules to build
+auto_security_modules=no
+if test "x${enable_security_certv_helpers:=yes}" = "xyes" ; then
+  SQUID_LOOK_FOR_MODULES([$srcdir/src/security/certv],[enable_security_certv_helpers])
+  auto_security_modules=yes
+fi
+
+enable_security_certv_helpers="`echo $enable_security_certv_helpers| sed -e 's/,/ /g;s/  */ /g'`"
+AC_MSG_NOTICE([Security certificate verify helper candidates: $enable_security_certv_helpers])
+SECURITY_CERTV_HELPERS=""
+if test "x$enable_security_certv_helpers" != "xno" ; then
+  for helper in $enable_security_certv_helpers; do
+    dir="$srcdir/src/security/certv/$helper"
+
+    # modules converted to autoconf macros already
+    # NP: we only need this list because m4_include() does not accept variables
+    if test "x$helper" = "xfake" ; then
+      m4_include([src/security/certv/fake/required.m4])
+
+    # modules not yet converted to autoconf macros (or third party drop-in's)
+    elif test -f "$dir/config.test" && sh "$dir/config.test" "$squid_host_os"; then
+      BUILD_HELPER="$helper"
+    fi
+
+    if test -d "$srcdir/src/security/certv/$helper"; then
+      if test "$BUILD_HELPER" != "$helper"; then
+        if test "x$auto_security_modules" = "xyes"; then
+          AC_MSG_NOTICE([Security certificate verify helper $helper ... found but cannot be built])
+        else
+          AC_MSG_ERROR([Security certificate verify helper $helper ... found but cannot be built])
+        fi
+      else
+        SECURITY_CERTV_HELPERS="$SECURITY_CERTV_HELPERS $BUILD_HELPER"
+      fi
+    else
+      AC_MSG_ERROR([Security certificate verify helper $helper ... not found])
+    fi
+  done
+fi
+AC_MSG_NOTICE([Security certificate verify helpers to be built: $SECURITY_CERTV_HELPERS])
+AC_SUBST(SECURITY_CERTV_HELPERS)