[rs-commit] r57 - in /mod_ca/trunk: ./ ChangeLog Makefile.in config.h.in configure configure.ac mod_ca_crl.c mod_ca_disk.c mod_ca_engine.c

rs-commit at redwax.eu rs-commit at redwax.eu
Wed Aug 28 23:24:38 CEST 2019


Author: minfrin at redwax.eu
Date: Wed Aug 28 23:24:37 2019
New Revision: 57

Log:
Updates to compile with openssl v1.1.0.

Added:
    mod_ca/trunk/config.h.in
Modified:
    mod_ca/trunk/   (props changed)
    mod_ca/trunk/ChangeLog
    mod_ca/trunk/Makefile.in
    mod_ca/trunk/configure
    mod_ca/trunk/configure.ac
    mod_ca/trunk/mod_ca_crl.c
    mod_ca/trunk/mod_ca_disk.c
    mod_ca/trunk/mod_ca_engine.c

Propchange: mod_ca/trunk/
------------------------------------------------------------------------------
--- svn:ignore	(original)
+++ svn:ignore	Wed Aug 28 23:24:37 2019
@@ -7,4 +7,4 @@
 *.spec
 config.status
 autom4te.cache
-
+stamp-h1

Modified: mod_ca/trunk/ChangeLog
==============================================================================
--- mod_ca/trunk/ChangeLog	(original)
+++ mod_ca/trunk/ChangeLog	Wed Aug 28 23:24:37 2019
@@ -1,5 +1,7 @@
 
 Changes with v0.2.0
+
+ *) Updates to compile with openssl v1.1.0. [Graham Leggett]
 
  *) Add an implementation of the ca_makekey hook to mod_ca_simple.
     [Graham Leggett]

Modified: mod_ca/trunk/Makefile.in
==============================================================================
--- mod_ca/trunk/Makefile.in	(original)
+++ mod_ca/trunk/Makefile.in	Wed Aug 28 23:24:37 2019
@@ -95,6 +95,7 @@
 am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
  configure.lineno config.status.lineno
 mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = config.h
 CONFIG_CLEAN_FILES = mod_ca.spec
 CONFIG_CLEAN_VPATH_FILES =
 AM_V_P = $(am__v_P_ at AM_V@)
@@ -116,10 +117,31 @@
     n|no|NO) false;; \
     *) (install-info --version) >/dev/null 2>&1;; \
   esac
-am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
-am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/mod_ca.spec.in \
-	AUTHORS COPYING ChangeLog INSTALL NEWS README compile \
-	install-sh missing
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \
+	$(LISP)config.h.in
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates.  Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+  BEGIN { nonempty = 0; } \
+  { items[$$0] = 1; nonempty = 1; } \
+  END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique.  This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+  list='$(am__tagged_files)'; \
+  unique=`for i in $$list; do \
+    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+  done | $(am__uniquify_input)`
+ETAGS = etags
+CTAGS = ctags
+CSCOPE = cscope
+AM_RECURSIVE_TARGETS = cscope
+am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in \
+	$(srcdir)/mod_ca.spec.in AUTHORS COPYING ChangeLog INSTALL \
+	NEWS README compile install-sh missing
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 distdir = $(PACKAGE)-$(VERSION)
 top_distdir = $(distdir)
@@ -231,7 +253,8 @@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 EXTRA_DIST = mod_ca.h mod_ca.c mod_ca_simple.c mod_ca_ldap.c mod_ca_crl.c mod_ca_disk.c mod_ca_engine.c mod_ca.spec
-all: all-am
+all: config.h
+	$(MAKE) $(AM_MAKEFLAGS) all-am
 
 .SUFFIXES:
 am--refresh: Makefile
@@ -267,14 +290,82 @@
 $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
 	$(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
 $(am__aclocal_m4_deps):
+
+config.h: stamp-h1
+	@test -f $@ || rm -f stamp-h1
+	@test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1
+
+stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
+	@rm -f stamp-h1
+	cd $(top_builddir) && $(SHELL) ./config.status config.h
+$(srcdir)/config.h.in:  $(am__configure_deps) 
+	($(am__cd) $(top_srcdir) && $(AUTOHEADER))
+	rm -f stamp-h1
+	touch $@
+
+distclean-hdr:
+	-rm -f config.h stamp-h1
 mod_ca.spec: $(top_builddir)/config.status $(srcdir)/mod_ca.spec.in
 	cd $(top_builddir) && $(SHELL) ./config.status $@
-tags TAGS:
-
-ctags CTAGS:
-
-cscope cscopelist:
-
+
+ID: $(am__tagged_files)
+	$(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-am
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+	set x; \
+	here=`pwd`; \
+	$(am__define_uniq_tagged_files); \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: ctags-am
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+	$(am__define_uniq_tagged_files); \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+cscope: cscope.files
+	test ! -s cscope.files \
+	  || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS)
+clean-cscope:
+	-rm -f cscope.files
+cscope.files: clean-cscope cscopelist
+cscopelist: cscopelist-am
+
+cscopelist-am: $(am__tagged_files)
+	list='$(am__tagged_files)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+	-rm -f cscope.out cscope.in.out cscope.po.out cscope.files
 
 distdir: $(BUILT_SOURCES)
 	$(MAKE) $(AM_MAKEFLAGS) distdir-am
@@ -443,7 +534,7 @@
 	       exit 1; } >&2
 check-am: all-am
 check: check-am
-all-am: Makefile all-local
+all-am: Makefile config.h all-local
 installdirs:
 install: install-am
 install-exec: install-exec-am
@@ -482,7 +573,7 @@
 distclean: distclean-am
 	-rm -f $(am__CONFIG_DISTCLEAN_FILES)
 	-rm -f Makefile
-distclean-am: clean-am distclean-generic
+distclean-am: clean-am distclean-generic distclean-hdr distclean-tags
 
 dvi: dvi-am
 
@@ -544,21 +635,22 @@
 
 uninstall-am:
 
-.MAKE: install-am install-strip
-
-.PHONY: all all-am all-local am--refresh check check-am clean \
-	clean-generic cscopelist-am ctags-am dist dist-all dist-bzip2 \
-	dist-gzip dist-lzip dist-shar dist-tarZ dist-xz dist-zip \
-	distcheck distclean distclean-generic distcleancheck distdir \
-	distuninstallcheck dvi dvi-am html html-am info info-am \
-	install install-am install-data install-data-am install-dvi \
-	install-dvi-am install-exec install-exec-am install-exec-local \
-	install-html install-html-am install-info install-info-am \
-	install-man install-pdf install-pdf-am install-ps \
-	install-ps-am install-strip installcheck installcheck-am \
-	installdirs maintainer-clean maintainer-clean-generic \
-	mostlyclean mostlyclean-generic pdf pdf-am ps ps-am tags-am \
-	uninstall uninstall-am
+.MAKE: all install-am install-strip
+
+.PHONY: CTAGS GTAGS TAGS all all-am all-local am--refresh check \
+	check-am clean clean-cscope clean-generic cscope cscopelist-am \
+	ctags ctags-am dist dist-all dist-bzip2 dist-gzip dist-lzip \
+	dist-shar dist-tarZ dist-xz dist-zip distcheck distclean \
+	distclean-generic distclean-hdr distclean-tags distcleancheck \
+	distdir distuninstallcheck dvi dvi-am html html-am info \
+	info-am install install-am install-data install-data-am \
+	install-dvi install-dvi-am install-exec install-exec-am \
+	install-exec-local install-html install-html-am install-info \
+	install-info-am install-man install-pdf install-pdf-am \
+	install-ps install-ps-am install-strip installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-generic pdf \
+	pdf-am ps ps-am tags tags-am uninstall uninstall-am
 
 .PRECIOUS: Makefile
 

Added: mod_ca/trunk/config.h.in
==============================================================================
--- mod_ca/trunk/config.h.in	(added)
+++ mod_ca/trunk/config.h.in	Wed Aug 28 23:24:37 2019
@@ -0,0 +1,67 @@
+/* config.h.in.  Generated from configure.ac by autoheader.  */
+
+/* Define to 1 if you have the `ASN1_STRING_get0_data' function. */
+#undef HAVE_ASN1_STRING_GET0_DATA
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* Define to 1 if you have the `X509_REVOKED_get0_revocationDate' function. */
+#undef HAVE_X509_REVOKED_GET0_REVOCATIONDATE
+
+/* Define to 1 if you have the `X509_REVOKED_get0_serialNumber' function. */
+#undef HAVE_X509_REVOKED_GET0_SERIALNUMBER
+
+/* Name of package */
+#undef PACKAGE
+
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
+
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
+
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
+
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
+
+/* Define to the home page for this package. */
+#undef PACKAGE_URL
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* Version number of package */
+#undef VERSION
+
+/* Define to `unsigned int' if <sys/types.h> does not define. */
+#undef size_t

Modified: mod_ca/trunk/configure
==============================================================================
--- mod_ca/trunk/configure	(original)
+++ mod_ca/trunk/configure	Wed Aug 28 23:24:37 2019
@@ -2834,6 +2834,8 @@
 ac_config_files="$ac_config_files Makefile mod_ca.spec"
 
 
+ac_config_headers="$ac_config_headers config.h"
+
 
 # Checks for programs.
 ac_ext=c
@@ -4733,12 +4735,13 @@
 
 
 # Checks for library functions.
-for ac_func in strcasecmp
+for ac_func in X509_REVOKED_get0_revocationDate X509_REVOKED_get0_serialNumber ASN1_STRING_get0_data
 do :
-  ac_fn_c_check_func "$LINENO" "strcasecmp" "ac_cv_func_strcasecmp"
-if test "x$ac_cv_func_strcasecmp" = xyes; then :
+  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
   cat >>confdefs.h <<_ACEOF
-#define HAVE_STRCASECMP 1
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
 
 fi
@@ -4836,43 +4839,7 @@
 # Let make expand exec_prefix.
 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
 
-# Transform confdefs.h into DEFS.
-# Protect against shell expansion while executing Makefile rules.
-# Protect against Makefile macro expansion.
-#
-# If the first sed substitution is executed (which looks for macros that
-# take arguments), then branch to the quote section.  Otherwise,
-# look for a macro that doesn't take arguments.
-ac_script='
-:mline
-/\\$/{
- N
- s,\\\n,,
- b mline
-}
-t clear
-:clear
-s/^[	 ]*#[	 ]*define[	 ][	 ]*\([^	 (][^	 (]*([^)]*)\)[	 ]*\(.*\)/-D\1=\2/g
-t quote
-s/^[	 ]*#[	 ]*define[	 ][	 ]*\([^	 ][^	 ]*\)[	 ]*\(.*\)/-D\1=\2/g
-t quote
-b any
-:quote
-s/[	 `~#$^&*(){}\\|;'\''"<>?]/\\&/g
-s/\[/\\&/g
-s/\]/\\&/g
-s/\$/$$/g
-H
-:any
-${
-	g
-	s/^\n//
-	s/\n/ /g
-	p
-}
-'
-DEFS=`sed -n "$ac_script" confdefs.h`
-
+DEFS=-DHAVE_CONFIG_H
 
 ac_libobjs=
 ac_ltlibobjs=
@@ -5330,11 +5297,15 @@
 "*) set x $ac_config_files; shift; ac_config_files=$*;;
 esac
 
+case $ac_config_headers in *"
+"*) set x $ac_config_headers; shift; ac_config_headers=$*;;
+esac
 
 
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 # Files that config.status was made for.
 config_files="$ac_config_files"
+config_headers="$ac_config_headers"
 config_commands="$ac_config_commands"
 
 _ACEOF
@@ -5356,9 +5327,14 @@
       --recheck    update $as_me by reconfiguring in the same conditions
       --file=FILE[:TEMPLATE]
                    instantiate the configuration file FILE
+      --header=FILE[:TEMPLATE]
+                   instantiate the configuration header FILE
 
 Configuration files:
 $config_files
+
+Configuration headers:
+$config_headers
 
 Configuration commands:
 $config_commands
@@ -5426,7 +5402,18 @@
     esac
     as_fn_append CONFIG_FILES " '$ac_optarg'"
     ac_need_defaults=false;;
-  --he | --h |  --help | --hel | -h )
+  --header | --heade | --head | --hea )
+    $ac_shift
+    case $ac_optarg in
+    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    as_fn_append CONFIG_HEADERS " '$ac_optarg'"
+    ac_need_defaults=false;;
+  --he | --h)
+    # Conflict between --help and --header
+    as_fn_error $? "ambiguous option: \`$1'
+Try \`$0 --help' for more information.";;
+  --help | --hel | -h )
     $as_echo "$ac_cs_usage"; exit ;;
   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
   | -silent | --silent | --silen | --sile | --sil | --si | --s)
@@ -5489,6 +5476,7 @@
   case $ac_config_target in
     "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
     "mod_ca.spec") CONFIG_FILES="$CONFIG_FILES mod_ca.spec" ;;
+    "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
     "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
 
   *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
@@ -5502,6 +5490,7 @@
 # bizarre bug on SunOS 4.1.3.
 if $ac_need_defaults; then
   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
+  test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
 fi
 
@@ -5690,8 +5679,116 @@
 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 fi # test -n "$CONFIG_FILES"
 
-
-eval set X "  :F $CONFIG_FILES      :C $CONFIG_COMMANDS"
+# Set up the scripts for CONFIG_HEADERS section.
+# No need to generate them if there are no CONFIG_HEADERS.
+# This happens for instance with `./config.status Makefile'.
+if test -n "$CONFIG_HEADERS"; then
+cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
+BEGIN {
+_ACEOF
+
+# Transform confdefs.h into an awk script `defines.awk', embedded as
+# here-document in config.status, that substitutes the proper values into
+# config.h.in to produce config.h.
+
+# Create a delimiter string that does not exist in confdefs.h, to ease
+# handling of long lines.
+ac_delim='%!_!# '
+for ac_last_try in false false :; do
+  ac_tt=`sed -n "/$ac_delim/p" confdefs.h`
+  if test -z "$ac_tt"; then
+    break
+  elif $ac_last_try; then
+    as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+  fi
+done
+
+# For the awk script, D is an array of macro values keyed by name,
+# likewise P contains macro parameters if any.  Preserve backslash
+# newline sequences.
+
+ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
+sed -n '
+s/.\{148\}/&'"$ac_delim"'/g
+t rset
+:rset
+s/^[	 ]*#[	 ]*define[	 ][	 ]*/ /
+t def
+d
+:def
+s/\\$//
+t bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[	 ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3"/p
+s/^ \('"$ac_word_re"'\)[	 ]*\(.*\)/D["\1"]=" \2"/p
+d
+:bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[	 ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3\\\\\\n"\\/p
+t cont
+s/^ \('"$ac_word_re"'\)[	 ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
+t cont
+d
+:cont
+n
+s/.\{148\}/&'"$ac_delim"'/g
+t clear
+:clear
+s/\\$//
+t bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/"/p
+d
+:bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
+b cont
+' <confdefs.h | sed '
+s/'"$ac_delim"'/"\\\
+"/g' >>$CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+  for (key in D) D_is_set[key] = 1
+  FS = ""
+}
+/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
+  line = \$ 0
+  split(line, arg, " ")
+  if (arg[1] == "#") {
+    defundef = arg[2]
+    mac1 = arg[3]
+  } else {
+    defundef = substr(arg[1], 2)
+    mac1 = arg[2]
+  }
+  split(mac1, mac2, "(") #)
+  macro = mac2[1]
+  prefix = substr(line, 1, index(line, defundef) - 1)
+  if (D_is_set[macro]) {
+    # Preserve the white space surrounding the "#".
+    print prefix "define", macro P[macro] D[macro]
+    next
+  } else {
+    # Replace #undef with comments.  This is necessary, for example,
+    # in the case of _POSIX_SOURCE, which is predefined and required
+    # on some systems where configure will not decide to define it.
+    if (defundef == "undef") {
+      print "/*", prefix defundef, macro, "*/"
+      next
+    }
+  }
+}
+{ print }
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+  as_fn_error $? "could not setup config headers machinery" "$LINENO" 5
+fi # test -n "$CONFIG_HEADERS"
+
+
+eval set X "  :F $CONFIG_FILES  :H $CONFIG_HEADERS    :C $CONFIG_COMMANDS"
 shift
 for ac_tag
 do
@@ -5910,7 +6007,64 @@
   esac \
   || as_fn_error $? "could not create $ac_file" "$LINENO" 5
  ;;
-
+  :H)
+  #
+  # CONFIG_HEADER
+  #
+  if test x"$ac_file" != x-; then
+    {
+      $as_echo "/* $configure_input  */" \
+      && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"
+    } >"$ac_tmp/config.h" \
+      || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+    if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
+$as_echo "$as_me: $ac_file is unchanged" >&6;}
+    else
+      rm -f "$ac_file"
+      mv "$ac_tmp/config.h" "$ac_file" \
+	|| as_fn_error $? "could not create $ac_file" "$LINENO" 5
+    fi
+  else
+    $as_echo "/* $configure_input  */" \
+      && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \
+      || as_fn_error $? "could not create -" "$LINENO" 5
+  fi
+# Compute "$ac_file"'s index in $config_headers.
+_am_arg="$ac_file"
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+  case $_am_header in
+    $_am_arg | $_am_arg:* )
+      break ;;
+    * )
+      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+  esac
+done
+echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" ||
+$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$_am_arg" : 'X\(//\)[^/]' \| \
+	 X"$_am_arg" : 'X\(//\)$' \| \
+	 X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$_am_arg" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`/stamp-h$_am_stamp_count
+ ;;
 
   :C)  { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5
 $as_echo "$as_me: executing $ac_file commands" >&6;}

Modified: mod_ca/trunk/configure.ac
==============================================================================
--- mod_ca/trunk/configure.ac	(original)
+++ mod_ca/trunk/configure.ac	Wed Aug 28 23:24:37 2019
@@ -6,6 +6,7 @@
 AM_INIT_AUTOMAKE([dist-bzip2])
 AC_CONFIG_FILES([Makefile mod_ca.spec])
 AC_CONFIG_SRCDIR([mod_ca.c])
+AC_CONFIG_HEADERS([config.h])
 
 # Checks for programs.
 AC_PROG_CC
@@ -61,7 +62,7 @@
 AC_TYPE_SIZE_T
 
 # Checks for library functions.
-AC_CHECK_FUNCS([strcasecmp])
+AC_CHECK_FUNCS([X509_REVOKED_get0_revocationDate X509_REVOKED_get0_serialNumber ASN1_STRING_get0_data])
 
 AC_SUBST(PACKAGE_VERSION)
 AC_OUTPUT

Modified: mod_ca/trunk/mod_ca_crl.c
==============================================================================
--- mod_ca/trunk/mod_ca_crl.c	(original)
+++ mod_ca/trunk/mod_ca_crl.c	Wed Aug 28 23:24:37 2019
@@ -41,6 +41,13 @@
 
 #include <time.h>
 
+#undef PACKAGE_BUGREPORT
+#undef PACKAGE_NAME
+#undef PACKAGE_STRING
+#undef PACKAGE_TARNAME
+#undef PACKAGE_VERSION
+#include "config.h"
+
 #define DEFAULT_CA_DAYS 365*1
 
 #define SERIAL_RAND_BITS 64
@@ -109,14 +116,14 @@
     return buf;
 }
 
-static ca_asn1_t *make_ASN1_INTEGER(apr_pool_t *pool, ASN1_INTEGER *integer)
+static ca_asn1_t *make_ASN1_INTEGER(apr_pool_t *pool, const ASN1_INTEGER *integer)
 {
     ca_asn1_t *buf = apr_palloc(pool, sizeof(ca_asn1_t));
     unsigned char *tmp;
 
-    buf->len = i2d_ASN1_INTEGER(integer, NULL);
+    buf->len = i2d_ASN1_INTEGER((ASN1_INTEGER *)integer, NULL);
     buf->val = tmp = apr_palloc(pool, buf->len);
-    i2d_ASN1_INTEGER(integer, &tmp);
+    i2d_ASN1_INTEGER((ASN1_INTEGER *)integer, &tmp);
 
     return buf;
 }
@@ -134,14 +141,14 @@
     return buf;
 }
 
-static ca_asn1_t *make_ASN1_TIME(apr_pool_t *pool, ASN1_TIME *time)
+static ca_asn1_t *make_ASN1_TIME(apr_pool_t *pool, const ASN1_TIME *time)
 {
     ca_asn1_t *buf = apr_palloc(pool, sizeof(ca_asn1_t));
     unsigned char *tmp;
 
-    buf->len = i2d_ASN1_TIME(time, NULL);
+    buf->len = i2d_ASN1_TIME((ASN1_TIME *)time, NULL);
     buf->val = tmp = apr_palloc(pool, buf->len);
-    i2d_ASN1_TIME(time, &tmp);
+    i2d_ASN1_TIME((ASN1_TIME *)time, &tmp);
 
     return buf;
 }
@@ -158,7 +165,7 @@
     return buf;
 }
 
-static apr_time_t ASN1_TIME_to_gmtime(ASN1_TIME *time)
+static apr_time_t ASN1_TIME_to_gmtime(const ASN1_TIME *time)
 {
     if (time) {
         struct tm ts;
@@ -233,7 +240,7 @@
     }
     else {
         int *status = apr_pcalloc(r->pool, sizeof(int));
-        ASN1_TIME *nextupdate, *thisupdate;
+        const ASN1_TIME *nextupdate, *thisupdate;
         ASN1_ENUMERATED *reason;
         ASN1_OBJECT *hold;
         ASN1_GENERALIZEDTIME *invalidity;
@@ -247,8 +254,13 @@
             *status = CA_CERT_STATUS_REVOKED;
 
             /* save away the revocation date */
+#if HAVE_X509_REVOKED_GET0_REVOCATIONDATE
+            apr_hash_set(certstatus, CA_REVOCATION_TIME, APR_HASH_KEY_STRING,
+                    make_ASN1_TIME(r->pool, X509_REVOKED_get0_revocationDate(revoked)));
+#else
             apr_hash_set(certstatus, CA_REVOCATION_TIME, APR_HASH_KEY_STRING,
                     make_ASN1_TIME(r->pool, revoked->revocationDate));
+#endif
 
             /* do we have a revocation reason? */
             reason = X509_REVOKED_get_ext_d2i(revoked, NID_crl_reason, NULL,
@@ -279,14 +291,14 @@
         }
 
         /* return the last update */
-        thisupdate = X509_CRL_get_lastUpdate(conf->crl);
+        thisupdate = X509_CRL_get0_lastUpdate(conf->crl);
         if (thisupdate) {
             apr_hash_set(certstatus, CA_THIS_UPDATE, APR_HASH_KEY_STRING,
                     make_ASN1_TIME(r->pool, thisupdate));
         }
 
         /* return the next update (if present) */
-        nextupdate = X509_CRL_get_nextUpdate(conf->crl);
+        nextupdate = X509_CRL_get0_nextUpdate(conf->crl);
         if (nextupdate) {
             apr_hash_set(certstatus, CA_NEXT_UPDATE, APR_HASH_KEY_STRING,
                     make_ASN1_TIME(r->pool, nextupdate));
@@ -342,7 +354,7 @@
     ca_config_rec *conf = dconf;
     BIO *in, *out;
     STACK_OF(X509_REVOKED) *revoked;
-    ASN1_TIME *nextupdate;
+    const ASN1_TIME *nextupdate;
     apr_int64_t i;
 
     /* set_crl() will be called twice. Don't bother
@@ -378,14 +390,18 @@
     for (i = 0; i < sk_X509_REVOKED_num(revoked); i++) {
         X509_REVOKED *r = sk_X509_REVOKED_value(revoked, i);
         if (r) {
-            ca_asn1_t *serial = make_ASN1_INTEGER(cmd->pool, r->serialNumber);
-            if (serial) {
+#if HAVE_X509_REVOKED_GET0_SERIALNUMBER
+        	ca_asn1_t *serial = make_ASN1_INTEGER(cmd->pool, X509_REVOKED_get0_serialNumber(r));
+#else
+        	ca_asn1_t *serial = make_ASN1_INTEGER(cmd->pool, r->serialNumber);
+#endif
+        	if (serial) {
                 apr_hash_set(conf->crl_index, serial->val, serial->len, r);
             }
         }
     }
 
-    nextupdate = X509_CRL_get_nextUpdate(conf->crl);
+    nextupdate = X509_CRL_get0_nextUpdate(conf->crl);
     if (nextupdate) {
         conf->crl_expires = ASN1_TIME_to_gmtime(nextupdate);
     }

Modified: mod_ca/trunk/mod_ca_disk.c
==============================================================================
--- mod_ca/trunk/mod_ca_disk.c	(original)
+++ mod_ca/trunk/mod_ca_disk.c	Wed Aug 28 23:24:37 2019
@@ -40,6 +40,13 @@
 #include "util_script.h"
 
 #include "mod_ca.h"
+
+#undef PACKAGE_BUGREPORT
+#undef PACKAGE_NAME
+#undef PACKAGE_STRING
+#undef PACKAGE_TARNAME
+#undef PACKAGE_VERSION
+#include "config.h"
 
 #define SERIAL_RAND_BITS 64
 
@@ -526,11 +533,19 @@
         if (transaction_id) {
             ASN1_STRING *s = parse_ASN1_STRING(r->pool, transaction_id);
             if (s) {
-                key = apr_pstrcat(r->pool,
+#if HAVE_ASN1_STRING_GET0_DATA
+            	key = apr_pstrcat(r->pool,
+                        apr_pstrndup(r->pool,
+                        		(const char *) ASN1_STRING_get0_data(s),
+                                ASN1_STRING_length(s)), ".",
+                        conf->transaction_path_suffix, NULL);
+#else
+            	key = apr_pstrcat(r->pool,
                         apr_pstrndup(r->pool,
                                 (const char *) ASN1_STRING_data(s),
                                 ASN1_STRING_length(s)), ".",
                         conf->transaction_path_suffix, NULL);
+#endif
             }
             else {
                 log_message(r, status, "The transactionID could not be parsed");
@@ -695,11 +710,19 @@
             ASN1_STRING *s = parse_ASN1_STRING(r->pool, transaction_id);
             if (s) {
                 path = conf->transaction_path;
+#if HAVE_ASN1_STRING_GET0_DATA
+                key = apr_pstrcat(r->pool,
+                        apr_pstrndup(r->pool,
+                                (const char *) ASN1_STRING_get0_data(s),
+                                ASN1_STRING_length(s)), ".",
+                        conf->transaction_path_suffix, NULL);
+#else
                 key = apr_pstrcat(r->pool,
                         apr_pstrndup(r->pool,
                                 (const char *) ASN1_STRING_data(s),
                                 ASN1_STRING_length(s)), ".",
                         conf->transaction_path_suffix, NULL);
+#endif
             }
             else {
                 log_message(r, status, "The transactionID could not be parsed");

Modified: mod_ca/trunk/mod_ca_engine.c
==============================================================================
--- mod_ca/trunk/mod_ca_engine.c	(original)
+++ mod_ca/trunk/mod_ca_engine.c	Wed Aug 28 23:24:37 2019
@@ -74,7 +74,7 @@
     int key_set;
     int days;
     int days_set;
-    apr_array_header_t *ext;
+    apr_hash_t *ext;
     int ext_set;
 } ca_config_rec;
 
@@ -272,6 +272,7 @@
 int ca_engine_sign(request_rec *r, apr_hash_t *params,
         const unsigned char **buffer, apr_size_t *len)
 {
+    X509V3_CTX ext_ctx;
     X509 *cert = NULL;
     X509_REQ *creq = NULL;
     EVP_PKEY *pktmp = NULL, *key = NULL;
@@ -279,8 +280,7 @@
     ASN1_INTEGER *sno = NULL;
     ASN1_GENERALIZEDTIME *t = NULL;
     STACK_OF(X509_EXTENSION) *exts;
-    int rv, i;
-    apr_time_t time;
+    apr_hash_index_t *iter;
     PKCS7 *p7;
     const unsigned char *tmp;
     unsigned char *tmp2;
@@ -288,6 +288,8 @@
     X509 *xs, *next;
     STACK_OF(X509) *chain;
     apr_size_t size;
+    apr_time_t time;
+    int rv, i;
 
     ca_config_rec *conf = ap_get_module_config(r->per_dir_config,
             &ca_engine_module);
@@ -344,12 +346,6 @@
 
     }
 
-    for (i = 0; i < conf->ext->nelts; i++) {
-        X509_add_ext(cert,
-                X509_EXTENSION_dup(((X509_EXTENSION **) conf->ext->elts)[i]),
-                -1);
-    }
-
     pktmp = X509_REQ_get_pubkey(creq);
     if (!pktmp) {
         log_message(r, APR_SUCCESS, "request had no public key");
@@ -429,6 +425,28 @@
     }
     apr_pool_cleanup_register(r->pool, key, signing_key_cleanup,
             apr_pool_cleanup_null);
+
+    X509V3_set_ctx(&ext_ctx, conf->signer, cert, NULL, NULL, 0);
+    for (iter = apr_hash_first(r->pool, conf->ext); iter; iter = apr_hash_next(iter)) {
+        const char *name, *val;
+
+        name = apr_hash_this_key(iter);
+        val = apr_hash_this_val(iter);
+
+        X509_EXTENSION *extension = X509V3_EXT_conf(NULL, &ext_ctx, (char *) name,
+                (char *) val);
+        if (!extension) {
+            log_message(r, APR_SUCCESS,
+                    apr_psprintf(r->pool,
+                            "extension '%s' could not be set to '%s'", name, val));
+
+            return HTTP_INTERNAL_SERVER_ERROR;
+        }
+        apr_pool_cleanup_register(r->pool, extension, ca_X509_EXTENSION_cleanup,
+                apr_pool_cleanup_null);
+
+        X509_add_ext(cert, extension, -1);
+    }
 
     if (!X509_sign(cert, key, EVP_sha256())) {
         log_message(r, APR_SUCCESS, "could not sign the request");
@@ -633,7 +651,7 @@
     ca_config_rec *conf = apr_pcalloc(p, sizeof(ca_config_rec));
 
     conf->days = DEFAULT_CA_DAYS;
-    conf->ext = apr_array_make(p, 5, sizeof(X509_EXTENSION *));
+    conf->ext = apr_hash_make(p);
 
     return conf;
 }
@@ -683,7 +701,10 @@
     new->key_set = add->key_set || base->key_set;
     new->days = (add->days_set == 0) ? base->days : add->days;
     new->days_set = add->days_set || base->days_set;
-    new->ext = (add->ext_set == 0) ? base->ext : add->ext;
+
+    new->ext =
+            (add->ext_set == 0) ?
+                    base->ext : apr_hash_overlay(p, add->ext, base->ext);
     new->ext_set = add->ext_set || base->ext_set;
 
     return new;
@@ -848,18 +869,7 @@
 {
     ca_config_rec *conf = dconf;
 
-    X509_EXTENSION **extension;
-
-    extension = apr_array_push(conf->ext);
-    *extension = X509V3_EXT_conf(NULL, NULL, (char *)name, (char *)val);
-    if (!*extension) {
-        return log_config(cmd,
-                apr_psprintf(cmd->pool,
-                        "CAEngineExtension '%s' could not be set to '%s'", name, val));
-    }
-    apr_pool_cleanup_register(cmd->pool, *extension, ca_X509_EXTENSION_cleanup,
-            apr_pool_cleanup_null);
-
+    apr_hash_set(conf->ext, name, APR_HASH_KEY_STRING, val);
     conf->ext_set = 1;
 
     return NULL;



More information about the rs-commit mailing list