Changeset 2dd044f in mod_gnutls
- Timestamp:
- Jan 11, 2013, 12:56:51 AM (10 years ago)
- Branches:
- debian/master, debian/stretch-backports, jessie-backports
- Children:
- 54b3065
- Parents:
- 15ffe0b (diff), 9d9b093 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
Makefile.in
r15ffe0b r2dd044f 138 138 LIBGNUTLS_CERTTOOL = @LIBGNUTLS_CERTTOOL@ 139 139 LIBGNUTLS_CFLAGS = @LIBGNUTLS_CFLAGS@ 140 LIBGNUTLS_CONFIG = @LIBGNUTLS_CONFIG@ 140 LIBGNUTLS_EXTRA_CFLAGS = @LIBGNUTLS_EXTRA_CFLAGS@ 141 LIBGNUTLS_EXTRA_CONFIG = @LIBGNUTLS_EXTRA_CONFIG@ 142 LIBGNUTLS_EXTRA_LIBS = @LIBGNUTLS_EXTRA_LIBS@ 141 143 LIBGNUTLS_LIBS = @LIBGNUTLS_LIBS@ 142 144 LIBGNUTLS_PREFIX = @LIBGNUTLS_PREFIX@ -
NEWS
r15ffe0b r2dd044f 1 ** Version 0. 4.3(2008-03-05)1 ** Version 0.5.1 (2008-03-05) 2 2 3 3 - Added --disable-srp configure option … … 5 5 - Better check for memcache (patch by Guillaume Rousse) 6 6 7 - Corrected possible memory leak in DBM support for resuming sessions. 7 - Corrected possible memory leak in DBM support for resuming sessions. 8 9 ** Version 0.5.0-alpha (2008-01-24) 10 11 - Added support for OpenPGP keys. The new directives are: 12 GnuTLSPGPKeyringFile, GnuTLSPGPCertificateFile, GnuTLSPGPKeyFile 8 13 9 14 ** Version 0.4.2 (2007-12-10) -
NOTICE
r15ffe0b r2dd044f 1 This product includes software developed by 2 Nikos Mavrogiannopoulos (http://www.gnutls.org/). 3 1 4 This product includes software developed by 2 5 Paul Querna (http://www.outoforder.cc/). -
README
r15ffe0b r2dd044f 55 55 56 56 # This is the Private key for your server. 57 GnuTLS KeyFile conf/server.key57 GnuTLSX509KeyFile conf/server.key 58 58 59 59 # This is the Server Certificate. 60 GnuTLS CertificateFile conf/server.cert60 GnuTLSX509CertificateFile conf/server.cert 61 61 </VirtualHost> 62 63 62 64 63 # a more advanced configuration … … 74 73 GNUTLSExportCertificates on 75 74 76 GnuTLS CertificateFile /etc/apache2/server-cert.pem77 GnuTLS KeyFile /etc/apache2/server-key.pem75 GnuTLSX509CertificateFile /etc/apache2/server-cert.pem 76 GnuTLSX509KeyFile /etc/apache2/server-key.pem 78 77 79 78 # To enable SRP you must have these files installed. Check the gnutls srptool. … … 85 84 # contains the CAs to verify client certificates. 86 85 GnuTLSClientVerify request 87 GnuTLS ClientCAFile ca.pem86 GnuTLSX509CAFile ca.pem 88 87 ... 89 88 </VirtualHost> 89 90 # A setup for OpenPGP and X.509 authentication 91 <VirtualHost 1.2.3.4:443> 92 Servername crystal.lan:443 93 GnuTLSEnable on 94 GnuTLSPriorities NORMAL:+COMP-NULL 95 96 # setup the openpgp keys 97 GnuTLSPGPCertificateFile /etc/apache2/test.pub.asc 98 GnuTLSPGPKeyFile /etc/apache2/test.sec.asc 99 100 # and the X.509 keys 101 GnuTLSCertificateFile /etc/apache2/server-cert.pem 102 GnuTLSKeyFile /etc/apache2/server-key.pem 103 GnuTLSClientVerify ignore 104 105 # To avoid using the default DH params 106 GnuTLSDHFile /etc/apache2/dh.pem 107 108 # these are only needed if GnuTLSClientVerify != ignore 109 GnuTLSClientCAFile ca.pem 110 GnuTLSPGPKeyringFile /etc/apache2/ring.asc 111 </VirtualHost> -
configure
r15ffe0b r2dd044f 1 1 #! /bin/sh 2 2 # Guess values for system-dependent variables and create Makefiles. 3 # Generated by GNU Autoconf 2.61 for mod_gnutls 0. 4.3.3 # Generated by GNU Autoconf 2.61 for mod_gnutls 0.5.1. 4 4 # 5 5 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, … … 727 727 PACKAGE_NAME='mod_gnutls' 728 728 PACKAGE_TARNAME='mod_gnutls' 729 PACKAGE_VERSION='0. 4.3'730 PACKAGE_STRING='mod_gnutls 0. 4.3'729 PACKAGE_VERSION='0.5.1' 730 PACKAGE_STRING='mod_gnutls 0.5.1' 731 731 PACKAGE_BUGREPORT='' 732 732 … … 903 903 APXS_EXTENSION 904 904 APXS_CFLAGS 905 LIBGNUTLS_CONFIG 905 LIBGNUTLS_EXTRA_CONFIG 906 LIBGNUTLS_EXTRA_CFLAGS 907 LIBGNUTLS_EXTRA_LIBS 906 908 LIBGNUTLS_CFLAGS 907 909 LIBGNUTLS_LIBS … … 1434 1436 # This message is too long to be a string in the A/UX 3.1 sh. 1435 1437 cat <<_ACEOF 1436 \`configure' configures mod_gnutls 0. 4.3to adapt to many kinds of systems.1438 \`configure' configures mod_gnutls 0.5.1 to adapt to many kinds of systems. 1437 1439 1438 1440 Usage: $0 [OPTION]... [VAR=VALUE]... … … 1505 1507 if test -n "$ac_init_help"; then 1506 1508 case $ac_init_help in 1507 short | recursive ) echo "Configuration of mod_gnutls 0. 4.3:";;1509 short | recursive ) echo "Configuration of mod_gnutls 0.5.1:";; 1508 1510 esac 1509 1511 cat <<\_ACEOF … … 1534 1536 --with-tags[=TAGS] include additional configurations [automatic] 1535 1537 --with-apxs=PATH Path to apxs 1536 --with-libgnutls- prefix=PFX Prefix where libgnutlsis installed (optional)1538 --with-libgnutls-extra-prefix=PFX Prefix where libgnutls-extra is installed (optional) 1537 1539 --with-apr-memcache-prefix=PATH 1538 1540 Install prefix for apr_memcache … … 1620 1622 if $ac_init_version; then 1621 1623 cat <<\_ACEOF 1622 mod_gnutls configure 0. 4.31624 mod_gnutls configure 0.5.1 1623 1625 generated by GNU Autoconf 2.61 1624 1626 … … 1634 1636 running configure, to aid debugging if configure makes a mistake. 1635 1637 1636 It was created by mod_gnutls $as_me 0. 4.3, which was1638 It was created by mod_gnutls $as_me 0.5.1, which was 1637 1639 generated by GNU Autoconf 2.61. Invocation command line was 1638 1640 … … 2005 2007 chmod +x config.nice 2006 2008 2007 MOD_GNUTLS_VERSION=0. 4.32009 MOD_GNUTLS_VERSION=0.5.1 2008 2010 2009 2011 … … 2506 2508 # Define the identity of the package. 2507 2509 PACKAGE=mod_gnutls 2508 VERSION=0. 4.32510 VERSION=0.5.1 2509 2511 2510 2512 … … 4551 4553 *-*-irix6*) 4552 4554 # Find out which ABI we are using. 4553 echo '#line 455 3"configure"' > conftest.$ac_ext4555 echo '#line 4555 "configure"' > conftest.$ac_ext 4554 4556 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 4555 4557 (eval $ac_compile) 2>&5 … … 7288 7290 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ 7289 7291 -e 's:$: $lt_compiler_flag:'` 7290 (eval echo "\"\$as_me:729 0: $lt_compile\"" >&5)7292 (eval echo "\"\$as_me:7292: $lt_compile\"" >&5) 7291 7293 (eval "$lt_compile" 2>conftest.err) 7292 7294 ac_status=$? 7293 7295 cat conftest.err >&5 7294 echo "$as_me:729 4: \$? = $ac_status" >&57296 echo "$as_me:7296: \$? = $ac_status" >&5 7295 7297 if (exit $ac_status) && test -s "$ac_outfile"; then 7296 7298 # The compiler can only warn and ignore the option if not recognized … … 7578 7580 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ 7579 7581 -e 's:$: $lt_compiler_flag:'` 7580 (eval echo "\"\$as_me:758 0: $lt_compile\"" >&5)7582 (eval echo "\"\$as_me:7582: $lt_compile\"" >&5) 7581 7583 (eval "$lt_compile" 2>conftest.err) 7582 7584 ac_status=$? 7583 7585 cat conftest.err >&5 7584 echo "$as_me:758 4: \$? = $ac_status" >&57586 echo "$as_me:7586: \$? = $ac_status" >&5 7585 7587 if (exit $ac_status) && test -s "$ac_outfile"; then 7586 7588 # The compiler can only warn and ignore the option if not recognized … … 7682 7684 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ 7683 7685 -e 's:$: $lt_compiler_flag:'` 7684 (eval echo "\"\$as_me:768 4: $lt_compile\"" >&5)7686 (eval echo "\"\$as_me:7686: $lt_compile\"" >&5) 7685 7687 (eval "$lt_compile" 2>out/conftest.err) 7686 7688 ac_status=$? 7687 7689 cat out/conftest.err >&5 7688 echo "$as_me:76 88: \$? = $ac_status" >&57690 echo "$as_me:7690: \$? = $ac_status" >&5 7689 7691 if (exit $ac_status) && test -s out/conftest2.$ac_objext 7690 7692 then … … 10044 10046 lt_status=$lt_dlunknown 10045 10047 cat > conftest.$ac_ext <<EOF 10046 #line 1004 6"configure"10048 #line 10048 "configure" 10047 10049 #include "confdefs.h" 10048 10050 … … 10144 10146 lt_status=$lt_dlunknown 10145 10147 cat > conftest.$ac_ext <<EOF 10146 #line 1014 6"configure"10148 #line 10148 "configure" 10147 10149 #include "confdefs.h" 10148 10150 … … 12564 12566 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ 12565 12567 -e 's:$: $lt_compiler_flag:'` 12566 (eval echo "\"\$as_me:1256 6: $lt_compile\"" >&5)12568 (eval echo "\"\$as_me:12568: $lt_compile\"" >&5) 12567 12569 (eval "$lt_compile" 2>conftest.err) 12568 12570 ac_status=$? 12569 12571 cat conftest.err >&5 12570 echo "$as_me:1257 0: \$? = $ac_status" >&512572 echo "$as_me:12572: \$? = $ac_status" >&5 12571 12573 if (exit $ac_status) && test -s "$ac_outfile"; then 12572 12574 # The compiler can only warn and ignore the option if not recognized … … 12668 12670 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ 12669 12671 -e 's:$: $lt_compiler_flag:'` 12670 (eval echo "\"\$as_me:1267 0: $lt_compile\"" >&5)12672 (eval echo "\"\$as_me:12672: $lt_compile\"" >&5) 12671 12673 (eval "$lt_compile" 2>out/conftest.err) 12672 12674 ac_status=$? 12673 12675 cat out/conftest.err >&5 12674 echo "$as_me:1267 4: \$? = $ac_status" >&512676 echo "$as_me:12676: \$? = $ac_status" >&5 12675 12677 if (exit $ac_status) && test -s out/conftest2.$ac_objext 12676 12678 then … … 14245 14247 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ 14246 14248 -e 's:$: $lt_compiler_flag:'` 14247 (eval echo "\"\$as_me:1424 7: $lt_compile\"" >&5)14249 (eval echo "\"\$as_me:14249: $lt_compile\"" >&5) 14248 14250 (eval "$lt_compile" 2>conftest.err) 14249 14251 ac_status=$? 14250 14252 cat conftest.err >&5 14251 echo "$as_me:1425 1: \$? = $ac_status" >&514253 echo "$as_me:14253: \$? = $ac_status" >&5 14252 14254 if (exit $ac_status) && test -s "$ac_outfile"; then 14253 14255 # The compiler can only warn and ignore the option if not recognized … … 14349 14351 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ 14350 14352 -e 's:$: $lt_compiler_flag:'` 14351 (eval echo "\"\$as_me:1435 1: $lt_compile\"" >&5)14353 (eval echo "\"\$as_me:14353: $lt_compile\"" >&5) 14352 14354 (eval "$lt_compile" 2>out/conftest.err) 14353 14355 ac_status=$? 14354 14356 cat out/conftest.err >&5 14355 echo "$as_me:1435 5: \$? = $ac_status" >&514357 echo "$as_me:14357: \$? = $ac_status" >&5 14356 14358 if (exit $ac_status) && test -s out/conftest2.$ac_objext 14357 14359 then … … 16549 16551 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ 16550 16552 -e 's:$: $lt_compiler_flag:'` 16551 (eval echo "\"\$as_me:1655 1: $lt_compile\"" >&5)16553 (eval echo "\"\$as_me:16553: $lt_compile\"" >&5) 16552 16554 (eval "$lt_compile" 2>conftest.err) 16553 16555 ac_status=$? 16554 16556 cat conftest.err >&5 16555 echo "$as_me:1655 5: \$? = $ac_status" >&516557 echo "$as_me:16557: \$? = $ac_status" >&5 16556 16558 if (exit $ac_status) && test -s "$ac_outfile"; then 16557 16559 # The compiler can only warn and ignore the option if not recognized … … 16839 16841 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ 16840 16842 -e 's:$: $lt_compiler_flag:'` 16841 (eval echo "\"\$as_me:1684 1: $lt_compile\"" >&5)16843 (eval echo "\"\$as_me:16843: $lt_compile\"" >&5) 16842 16844 (eval "$lt_compile" 2>conftest.err) 16843 16845 ac_status=$? 16844 16846 cat conftest.err >&5 16845 echo "$as_me:1684 5: \$? = $ac_status" >&516847 echo "$as_me:16847: \$? = $ac_status" >&5 16846 16848 if (exit $ac_status) && test -s "$ac_outfile"; then 16847 16849 # The compiler can only warn and ignore the option if not recognized … … 16943 16945 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ 16944 16946 -e 's:$: $lt_compiler_flag:'` 16945 (eval echo "\"\$as_me:1694 5: $lt_compile\"" >&5)16947 (eval echo "\"\$as_me:16947: $lt_compile\"" >&5) 16946 16948 (eval "$lt_compile" 2>out/conftest.err) 16947 16949 ac_status=$? 16948 16950 cat out/conftest.err >&5 16949 echo "$as_me:169 49: \$? = $ac_status" >&516951 echo "$as_me:16951: \$? = $ac_status" >&5 16950 16952 if (exit $ac_status) && test -s out/conftest2.$ac_objext 16951 16953 then … … 20234 20236 MIN_TLS_VERSION=2.2.1 20235 20237 20236 # Check whether --with-libgnutls- prefix was given.20237 if test "${with_libgnutls_ prefix+set}" = set; then20238 withval=$with_libgnutls_ prefix; libgnutls_config_prefix="$withval"20239 else 20240 libgnutls_ config_prefix=""20241 fi 20242 20243 20244 if test x$libgnutls_ config_prefix != x ; then20245 if test x${LIBGNUTLS_ CONFIG+set} != xset ; then20246 LIBGNUTLS_ CONFIG=$libgnutls_config_prefix/bin/libgnutls-config20238 # Check whether --with-libgnutls-extra-prefix was given. 20239 if test "${with_libgnutls_extra_prefix+set}" = set; then 20240 withval=$with_libgnutls_extra_prefix; libgnutls_extra_config_prefix="$withval" 20241 else 20242 libgnutls_extra_config_prefix="" 20243 fi 20244 20245 20246 if test x$libgnutls_extra_config_prefix != x ; then 20247 if test x${LIBGNUTLS_EXTRA_CONFIG+set} != xset ; then 20248 LIBGNUTLS_EXTRA_CONFIG=$libgnutls_extra_config_prefix/bin/libgnutls-extra-config 20247 20249 fi 20248 20250 fi 20249 20251 20250 # Extract the first word of "libgnutls- config", so it can be a program name with args.20251 set dummy libgnutls- config; ac_word=$220252 # Extract the first word of "libgnutls-extra-config", so it can be a program name with args. 20253 set dummy libgnutls-extra-config; ac_word=$2 20252 20254 { echo "$as_me:$LINENO: checking for $ac_word" >&5 20253 20255 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } 20254 if test "${ac_cv_path_LIBGNUTLS_ CONFIG+set}" = set; then20256 if test "${ac_cv_path_LIBGNUTLS_EXTRA_CONFIG+set}" = set; then 20255 20257 echo $ECHO_N "(cached) $ECHO_C" >&6 20256 20258 else 20257 case $LIBGNUTLS_ CONFIG in20259 case $LIBGNUTLS_EXTRA_CONFIG in 20258 20260 [\\/]* | ?:[\\/]*) 20259 ac_cv_path_LIBGNUTLS_ CONFIG="$LIBGNUTLS_CONFIG" # Let the user override the test with a path.20261 ac_cv_path_LIBGNUTLS_EXTRA_CONFIG="$LIBGNUTLS_EXTRA_CONFIG" # Let the user override the test with a path. 20260 20262 ;; 20261 20263 *) … … 20267 20269 for ac_exec_ext in '' $ac_executable_extensions; do 20268 20270 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then 20269 ac_cv_path_LIBGNUTLS_ CONFIG="$as_dir/$ac_word$ac_exec_ext"20271 ac_cv_path_LIBGNUTLS_EXTRA_CONFIG="$as_dir/$ac_word$ac_exec_ext" 20270 20272 echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 20271 20273 break 2 … … 20275 20277 IFS=$as_save_IFS 20276 20278 20277 test -z "$ac_cv_path_LIBGNUTLS_ CONFIG" && ac_cv_path_LIBGNUTLS_CONFIG="no"20279 test -z "$ac_cv_path_LIBGNUTLS_EXTRA_CONFIG" && ac_cv_path_LIBGNUTLS_EXTRA_CONFIG="no" 20278 20280 ;; 20279 20281 esac 20280 20282 fi 20281 LIBGNUTLS_ CONFIG=$ac_cv_path_LIBGNUTLS_CONFIG20282 if test -n "$LIBGNUTLS_ CONFIG"; then20283 { echo "$as_me:$LINENO: result: $LIBGNUTLS_ CONFIG" >&520284 echo "${ECHO_T}$LIBGNUTLS_ CONFIG" >&6; }20283 LIBGNUTLS_EXTRA_CONFIG=$ac_cv_path_LIBGNUTLS_EXTRA_CONFIG 20284 if test -n "$LIBGNUTLS_EXTRA_CONFIG"; then 20285 { echo "$as_me:$LINENO: result: $LIBGNUTLS_EXTRA_CONFIG" >&5 20286 echo "${ECHO_T}$LIBGNUTLS_EXTRA_CONFIG" >&6; } 20285 20287 else 20286 20288 { echo "$as_me:$LINENO: result: no" >&5 … … 20293 20295 echo $ECHO_N "checking for libgnutls - version >= $min_libgnutls_version... $ECHO_C" >&6; } 20294 20296 no_libgnutls="" 20295 if test "$LIBGNUTLS_ CONFIG" = "no" ; then20297 if test "$LIBGNUTLS_EXTRA_CONFIG" = "no" ; then 20296 20298 no_libgnutls=yes 20297 20299 else 20298 LIBGNUTLS_ CFLAGS=`$LIBGNUTLS_CONFIG $libgnutls_config_args --cflags`20299 LIBGNUTLS_ LIBS=`$LIBGNUTLS_CONFIG $libgnutls_config_args --libs`20300 libgnutls_ config_version=`$LIBGNUTLS_CONFIG $libgnutls_config_args --version`20300 LIBGNUTLS_EXTRA_CFLAGS=`$LIBGNUTLS_EXTRA_CONFIG $libgnutls_extra_config_args --cflags` 20301 LIBGNUTLS_EXTRA_LIBS=`$LIBGNUTLS_EXTRA_CONFIG $libgnutls_extra_config_args --libs` 20302 libgnutls_extra_config_version=`$LIBGNUTLS_EXTRA_CONFIG $libgnutls_extra_config_args --version` 20301 20303 20302 20304 20303 20305 ac_save_CFLAGS="$CFLAGS" 20304 20306 ac_save_LIBS="$LIBS" 20305 CFLAGS="$CFLAGS $LIBGNUTLS_ CFLAGS"20306 LIBS="$LIBS $LIBGNUTLS_ LIBS"20307 CFLAGS="$CFLAGS $LIBGNUTLS_EXTRA_CFLAGS" 20308 LIBS="$LIBS $LIBGNUTLS_EXTRA_LIBS" 20307 20309 rm -f conf.libgnutlstest 20308 20310 if test "$cross_compiling" = yes; then … … 20319 20321 #include <stdlib.h> 20320 20322 #include <string.h> 20321 #include <gnutls/ gnutls.h>20323 #include <gnutls/extra.h> 20322 20324 20323 20325 int … … 20326 20328 system ("touch conf.libgnutlstest"); 20327 20329 20328 if( strcmp( gnutls_ check_version(NULL), "$libgnutls_config_version" ) )20330 if( strcmp( gnutls_extra_check_version(NULL), "$libgnutls_extra_config_version" ) ) 20329 20331 { 20330 printf("\n*** 'libgnutls- config --version' returned %s, but LIBGNUTLS(%s)\n",20331 "$libgnutls_ config_version", gnutls_check_version(NULL) );20332 printf("*** was found! If libgnutls- config was correct, then it is best\n");20333 printf("*** to remove the old version of LIBGNUTLS . You may also be able to fix the error\n");20332 printf("\n*** 'libgnutls-extra-config --version' returned %s, but LIBGNUTLS_EXTRA (%s)\n", 20333 "$libgnutls_extra_config_version", gnutls_extra_check_version(NULL) ); 20334 printf("*** was found! If libgnutls-extra-config was correct, then it is best\n"); 20335 printf("*** to remove the old version of LIBGNUTLS_EXTRA. You may also be able to fix the error\n"); 20334 20336 printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); 20335 20337 printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); 20336 20338 printf("*** required on your system.\n"); 20337 printf("*** If libgnutls- config was wrong, set the environment variable LIBGNUTLS_CONFIG\n");20338 printf("*** to point to the correct copy of libgnutls- config, and remove the file config.cache\n");20339 printf("*** If libgnutls-extra-config was wrong, set the environment variable LIBGNUTLS_EXTRA_CONFIG\n"); 20340 printf("*** to point to the correct copy of libgnutls-extra-config, and remove the file config.cache\n"); 20339 20341 printf("*** before re-running configure\n"); 20340 20342 } 20341 else if ( strcmp(gnutls_ check_version(NULL), LIBGNUTLS_VERSION ) )20343 else if ( strcmp(gnutls_extra_check_version(NULL), LIBGNUTLS_EXTRA_VERSION ) ) 20342 20344 { 20343 printf("\n*** LIBGNUTLS header file (version %s) does not match\n", LIBGNUTLS_VERSION); 20344 printf("*** library (version %s)\n", gnutls_check_version(NULL) ); 20345 printf("\n*** LIBGNUTLS_EXTRA header file (version %s) does not match\n", LIBGNUTLS_EXTRA_VERSION); 20346 printf("*** library (version %s). This is may be due to a different version of gnutls\n", gnutls_extra_check_version(NULL) ); 20347 printf("*** and gnutls-extra.\n"); 20345 20348 } 20346 20349 else 20347 20350 { 20348 if ( gnutls_ check_version( "$min_libgnutls_version" ) )20351 if ( gnutls_extra_check_version( "$min_libgnutls_version" ) ) 20349 20352 { 20350 20353 return 0; … … 20352 20355 else 20353 20356 { 20354 printf("no\n*** An old version of LIBGNUTLS (%s) was found.\n",20355 gnutls_ check_version(NULL) );20356 printf("*** You need a version of LIBGNUTLS newer than %s. The latest version of\n",20357 printf("no\n*** An old version of LIBGNUTLS_EXTRA (%s) was found.\n", 20358 gnutls_extra_check_version(NULL) ); 20359 printf("*** You need a version of LIBGNUTLS_EXTRA newer than %s. The latest version of\n", 20357 20360 "$min_libgnutls_version" ); 20358 printf("*** LIBGNUTLS is always available from ftp://gnutls.hellug.gr/pub/gnutls.\n");20361 printf("*** LIBGNUTLS_EXTRA is always available from ftp://gnutls.hellug.gr/pub/gnutls.\n"); 20359 20362 printf("*** \n"); 20360 20363 printf("*** If you have already installed a sufficiently new version, this error\n"); 20361 printf("*** probably means that the wrong copy of the libgnutls- config shell script is\n");20364 printf("*** probably means that the wrong copy of the libgnutls-extra-config shell script is\n"); 20362 20365 printf("*** being found. The easiest way to fix this is to remove the old version\n"); 20363 printf("*** of LIBGNUTLS , but you can also set the LIBGNUTLS_CONFIG environment to point to the\n");20364 printf("*** correct copy of libgnutls- config. (In this case, you will have to\n");20366 printf("*** of LIBGNUTLS_EXTRA, but you can also set the LIBGNUTLS_EXTRA_CONFIG environment to point to the\n"); 20367 printf("*** correct copy of libgnutls-extra-config. (In this case, you will have to\n"); 20365 20368 printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); 20366 20369 printf("*** so that the correct libraries are found at run-time))\n"); … … 20419 20422 echo "${ECHO_T}no" >&6; } 20420 20423 fi 20421 if test "$LIBGNUTLS_ CONFIG" = "no" ; then20422 echo "*** The libgnutls- config script installed by LIBGNUTLScould not be found"20423 echo "*** If LIBGNUTLS was installed in PREFIX, make sure PREFIX/bin is in"20424 echo "*** your path, or set the LIBGNUTLS_ CONFIG environment variable to the"20425 echo "*** full path to libgnutls- config."20424 if test "$LIBGNUTLS_EXTRA_CONFIG" = "no" ; then 20425 echo "*** The libgnutls-extra-config script installed by LIBGNUTLS_EXTRA could not be found" 20426 echo "*** If LIBGNUTLS_EXTRA was installed in PREFIX, make sure PREFIX/bin is in" 20427 echo "*** your path, or set the LIBGNUTLS_EXTRA_CONFIG environment variable to the" 20428 echo "*** full path to libgnutls-extra-config." 20426 20429 else 20427 20430 if test -f conf.libgnutlstest ; then … … 20429 20432 else 20430 20433 echo "*** Could not run libgnutls test program, checking why..." 20431 CFLAGS="$CFLAGS $LIBGNUTLS_ CFLAGS"20432 LIBS="$LIBS $LIBGNUTLS_ LIBS"20434 CFLAGS="$CFLAGS $LIBGNUTLS_EXTRA_CFLAGS" 20435 LIBS="$LIBS $LIBGNUTLS_EXTRA_LIBS" 20433 20436 cat >conftest.$ac_ext <<_ACEOF 20434 20437 /* confdefs.h. */ … … 20441 20444 #include <stdlib.h> 20442 20445 #include <string.h> 20443 #include <gnutls/ gnutls.h>20446 #include <gnutls/extra.h> 20444 20447 20445 20448 int 20446 20449 main () 20447 20450 { 20448 return !!gnutls_ check_version(NULL);20451 return !!gnutls_extra_check_version(NULL); 20449 20452 ; 20450 20453 return 0; … … 20470 20473 $as_test_x conftest$ac_exeext; then 20471 20474 echo "*** The test program compiled, but did not run. This usually means" 20472 echo "*** that the run-time linker is not finding LIBGNUTLS or finding the wrong"20473 echo "*** version of LIBGNUTLS . If it is not finding LIBGNUTLS, you'll need to set your"20475 echo "*** that the run-time linker is not finding LIBGNUTLS_EXTRA or finding the wrong" 20476 echo "*** version of LIBGNUTLS_EXTRA. If it is not finding LIBGNUTLS_EXTRA, you'll need to set your" 20474 20477 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" 20475 20478 echo "*** to the installed location Also, make sure you have run ldconfig if that" … … 20484 20487 20485 20488 echo "*** The test program failed to compile or link. See the file config.log for the" 20486 echo "*** exact error that occured. This usually means LIBGNUTLS was incorrectly installed"20487 echo "*** or that you have moved LIBGNUTLS since it was installed. In the latter case, you"20488 echo "*** may want to edit the libgnutls- config script: $LIBGNUTLS_CONFIG"20489 echo "*** exact error that occured. This usually means LIBGNUTLS_EXTRA was incorrectly installed" 20490 echo "*** or that you have moved LIBGNUTLS_EXTRA since it was installed. In the latter case, you" 20491 echo "*** may want to edit the libgnutls-extra-config script: $LIBGNUTLS_EXTRA_CONFIG" 20489 20492 fi 20490 20493 … … 20495 20498 fi 20496 20499 fi 20497 LIBGNUTLS_ CFLAGS=""20498 LIBGNUTLS_ LIBS=""20500 LIBGNUTLS_EXTRA_CFLAGS="" 20501 LIBGNUTLS_EXTRA_LIBS="" 20499 20502 { { echo "$as_me:$LINENO: error: 20500 20503 *** 20501 *** libgnutls were not found. You may want to get it from20504 *** libgnutls and libgnutls-extra were not found. You may want to get it from 20502 20505 *** http://www.gnutls.org/ 20503 20506 *** … … 20505 20508 echo "$as_me: error: 20506 20509 *** 20507 *** libgnutls were not found. You may want to get it from20510 *** libgnutls and libgnutls-extra were not found. You may want to get it from 20508 20511 *** http://www.gnutls.org/ 20509 20512 *** … … 20515 20518 20516 20519 20517 LIBGNUTLS_VERSION=`$LIBGNUTLS_CONFIG $libgnutls_config_args --version` 20518 LIBGNUTLS_PREFIX="`$LIBGNUTLS_CONFIG $libgnutls_config_args --prefix`" 20520 LIBGNUTLS_LIBS=$LIBGNUTLS_EXTRA_LIBS 20521 LIBGNUTLS_CFLAGS=$LIBGNUTLS_EXTRA_CFLAGS 20522 LIBGNUTLS_VERSION=`$LIBGNUTLS_EXTRA_CONFIG $libgnutls_extra_config_args --version` 20523 LIBGNUTLS_PREFIX="`$LIBGNUTLS_EXTRA_CONFIG $libgnutls_extra_config_args --prefix`" 20519 20524 GNUTLS_CERTTOOL="${LIBGNUTLS_PREFIX}/bin/certtool" 20520 20525 … … 20526 20531 20527 20532 20533 20534 # Check whether --enable-srp was given. 20535 if test "${enable_srp+set}" = set; then 20536 enableval=$enable_srp; use_srp=$enableval 20537 else 20538 use_srp=yes 20539 fi 20540 20541 20542 SRP_CFLAGS="" 20543 if test "$use_srp" != "no"; then 20544 SRP_CFLAGS="-DENABLE_SRP=1" 20545 fi 20546 { echo "$as_me:$LINENO: checking whether to enable SRP functionality" >&5 20547 echo $ECHO_N "checking whether to enable SRP functionality... $ECHO_C" >&6; } 20548 { echo "$as_me:$LINENO: result: $use_srp" >&5 20549 echo "${ECHO_T}$use_srp" >&6; } 20528 20550 20529 20551 … … 21273 21295 21274 21296 21275 # Check whether --enable-srp was given. 21276 if test "${enable_srp+set}" = set; then 21277 enableval=$enable_srp; use_srp=$enableval 21278 else 21279 use_srp=yes 21280 fi 21281 21282 21283 SRP_CFLAGS="" 21284 if test "$use_srp" != "no"; then 21285 SRP_CFLAGS="-DENABLE_SRP=1" 21286 fi 21287 { echo "$as_me:$LINENO: checking whether to enable SRP functionality" >&5 21288 echo $ECHO_N "checking whether to enable SRP functionality... $ECHO_C" >&6; } 21289 { echo "$as_me:$LINENO: result: $use_srp" >&5 21290 echo "${ECHO_T}$use_srp" >&6; } 21291 21292 MODULE_CFLAGS="${LIBGNUTLS_CFLAGS} ${SRP_CFLAGS} ${APR_MEMCACHE_CFLAGS} ${APXS_CFLAGS} ${AP_INCLUDES} ${APR_INCLUDES} ${APU_INCLUDES}" 21293 MODULE_LIBS="${APR_MEMCACHE_LIBS} ${LIBGNUTLS_LIBS}" 21297 MODULE_CFLAGS="${LIBGNUTLS_EXTRA_CFLAGS} ${SRP_CFLAGS} ${APR_MEMCACHE_CFLAGS} ${APXS_CFLAGS} ${AP_INCLUDES} ${APR_INCLUDES} ${APU_INCLUDES}" 21298 MODULE_LIBS="${APR_MEMCACHE_LIBS} ${LIBGNUTLS_EXTRA_LIBS}" 21294 21299 21295 21300 … … 21722 21727 # values after options handling. 21723 21728 ac_log=" 21724 This file was extended by mod_gnutls $as_me 0. 4.3, which was21729 This file was extended by mod_gnutls $as_me 0.5.1, which was 21725 21730 generated by GNU Autoconf 2.61. Invocation command line was 21726 21731 … … 21775 21780 cat >>$CONFIG_STATUS <<_ACEOF 21776 21781 ac_cs_version="\\ 21777 mod_gnutls config.status 0. 4.321782 mod_gnutls config.status 0.5.1 21778 21783 configured by $0, generated by GNU Autoconf 2.61, 21779 21784 with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" … … 22132 22137 APXS_EXTENSION!$APXS_EXTENSION$ac_delim 22133 22138 APXS_CFLAGS!$APXS_CFLAGS$ac_delim 22134 LIBGNUTLS_CONFIG!$LIBGNUTLS_CONFIG$ac_delim 22139 LIBGNUTLS_EXTRA_CONFIG!$LIBGNUTLS_EXTRA_CONFIG$ac_delim 22140 LIBGNUTLS_EXTRA_CFLAGS!$LIBGNUTLS_EXTRA_CFLAGS$ac_delim 22141 LIBGNUTLS_EXTRA_LIBS!$LIBGNUTLS_EXTRA_LIBS$ac_delim 22135 22142 LIBGNUTLS_CFLAGS!$LIBGNUTLS_CFLAGS$ac_delim 22136 22143 LIBGNUTLS_LIBS!$LIBGNUTLS_LIBS$ac_delim … … 22147 22154 _ACEOF 22148 22155 22149 if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 5 1; then22156 if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 53; then 22150 22157 break 22151 22158 elif $ac_last_try; then … … 22752 22759 echo " * Apache Modules directory: ${AP_LIBEXECDIR}" 22753 22760 echo " * GnuTLS Library version: ${LIBGNUTLS_VERSION}" 22754 echo " * SRP authentication: ${use_srp}"22761 echo " * SRP Authentication: ${use_srp}" 22755 22762 echo "" 22756 22763 echo "---" -
configure.ac
r15ffe0b r2dd044f 1 1 dnl 2 AC_INIT(mod_gnutls, 0. 4.3)2 AC_INIT(mod_gnutls, 0.5.1) 3 3 OOO_CONFIG_NICE(config.nice) 4 4 MOD_GNUTLS_VERSION=AC_PACKAGE_VERSION … … 30 30 31 31 MIN_TLS_VERSION=2.2.1 32 AM_PATH_LIBGNUTLS ($MIN_TLS_VERSION,,32 AM_PATH_LIBGNUTLS_EXTRA($MIN_TLS_VERSION,, 33 33 AC_MSG_ERROR([[ 34 34 *** 35 *** libgnutls were not found. You may want to get it from35 *** libgnutls and libgnutls-extra were not found. You may want to get it from 36 36 *** http://www.gnutls.org/ 37 37 *** 38 38 ]])) 39 40 dnl CHECK_LUA()41 42 have_apr_memcache=043 CHECK_APR_MEMCACHE([have_apr_memcache=1], [have_apr_memcache=0])44 AC_SUBST(have_apr_memcache)45 39 46 40 AC_ARG_ENABLE(srp, … … 51 45 SRP_CFLAGS="" 52 46 if test "$use_srp" != "no"; then 53 SRP_CFLAGS="-DENABLE_SRP=1"47 SRP_CFLAGS="-DENABLE_SRP=1" 54 48 fi 55 49 AC_MSG_CHECKING([whether to enable SRP functionality]) 56 50 AC_MSG_RESULT($use_srp) 57 51 58 MODULE_CFLAGS="${LIBGNUTLS_CFLAGS} ${SRP_CFLAGS} ${APR_MEMCACHE_CFLAGS} ${APXS_CFLAGS} ${AP_INCLUDES} ${APR_INCLUDES} ${APU_INCLUDES}" 59 MODULE_LIBS="${APR_MEMCACHE_LIBS} ${LIBGNUTLS_LIBS}" 52 dnl CHECK_LUA() 53 54 have_apr_memcache=0 55 CHECK_APR_MEMCACHE([have_apr_memcache=1], [have_apr_memcache=0]) 56 AC_SUBST(have_apr_memcache) 57 58 MODULE_CFLAGS="${LIBGNUTLS_EXTRA_CFLAGS} ${SRP_CFLAGS} ${APR_MEMCACHE_CFLAGS} ${APXS_CFLAGS} ${AP_INCLUDES} ${APR_INCLUDES} ${APU_INCLUDES}" 59 MODULE_LIBS="${APR_MEMCACHE_LIBS} ${LIBGNUTLS_EXTRA_LIBS}" 60 60 61 61 AC_SUBST(MODULE_CFLAGS) … … 68 68 echo "Configuration summary for mod_gnutls:" 69 69 echo "" 70 echo " * mod_gnutls version: 71 echo " * Apache Modules directory: 72 echo " * GnuTLS Library version: 73 echo " * SRP authentication: ${use_srp}"70 echo " * mod_gnutls version: ${MOD_GNUTLS_VERSION}" 71 echo " * Apache Modules directory: ${AP_LIBEXECDIR}" 72 echo " * GnuTLS Library version: ${LIBGNUTLS_VERSION}" 73 echo " * SRP Authentication: ${use_srp}" 74 74 echo "" 75 75 echo "---" -
include/mod_gnutls.h.in
r15ffe0b r2dd044f 30 30 #include <gcrypt.h> 31 31 #include <gnutls/gnutls.h> 32 #include <gnutls/extra.h> 33 #include <gnutls/openpgp.h> 32 34 #include <gnutls/x509.h> 33 35 … … 95 97 unsigned int certs_x509_num; 96 98 gnutls_x509_privkey_t privkey_x509; 99 gnutls_openpgp_crt_t cert_pgp; /* A certificate chain */ 100 gnutls_openpgp_privkey_t privkey_pgp; 97 101 int enabled; 98 102 /* whether to send the PEM encoded certificates … … 109 113 const char* srp_tpasswd_conf_file; 110 114 gnutls_x509_crt_t ca_list[MAX_CA_CRTS]; 115 gnutls_openpgp_keyring_t pgp_list; 111 116 unsigned int ca_list_size; 112 117 int client_verify_mode; … … 255 260 const char *arg); 256 261 262 const char *mgs_set_pgpcert_file(cmd_parms * parms, void *dummy, 263 const char *arg); 264 265 const char *mgs_set_pgpkey_file(cmd_parms * parms, void *dummy, 266 const char *arg); 267 257 268 const char *mgs_set_cache(cmd_parms * parms, void *dummy, 258 269 const char *type, const char* arg); … … 265 276 266 277 const char *mgs_set_client_ca_file(cmd_parms * parms, void *dummy, 278 const char *arg); 279 280 const char *mgs_set_keyring_file(cmd_parms * parms, void *dummy, 267 281 const char *arg); 268 282 -
m4/libgnutls.m4
r15ffe0b r2dd044f 1 dnl Autoconf macros for libgnutls 1 dnl Autoconf macros for libgnutls-extra 2 2 dnl $id$ 3 3 4 # Modified for LIBGNUTLS -- nmav4 # Modified for LIBGNUTLS_EXTRA -- nmav 5 5 # Configure paths for LIBGCRYPT 6 6 # Shamelessly stolen from the one of XDELTA by Owen Taylor 7 7 # Werner Koch 99-12-09 8 8 9 dnl AM_PATH_LIBGNUTLS ([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]])10 dnl Test for libgnutls , and define LIBGNUTLS_CFLAGS and LIBGNUTLS_LIBS9 dnl AM_PATH_LIBGNUTLS_EXTRA([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]]) 10 dnl Test for libgnutls-extra, and define LIBGNUTLS_EXTRA_CFLAGS and LIBGNUTLS_EXTRA_LIBS 11 11 dnl 12 AC_DEFUN([AM_PATH_LIBGNUTLS ],12 AC_DEFUN([AM_PATH_LIBGNUTLS_EXTRA], 13 13 [dnl 14 dnl Get the cflags and libraries from the libgnutls- config script14 dnl Get the cflags and libraries from the libgnutls-extra-config script 15 15 dnl 16 AC_ARG_WITH(libgnutls- prefix,17 [ --with-libgnutls- prefix=PFX Prefix where libgnutlsis installed (optional)],18 libgnutls_ config_prefix="$withval", libgnutls_config_prefix="")16 AC_ARG_WITH(libgnutls-extra-prefix, 17 [ --with-libgnutls-extra-prefix=PFX Prefix where libgnutls-extra is installed (optional)], 18 libgnutls_extra_config_prefix="$withval", libgnutls_extra_config_prefix="") 19 19 20 if test x$libgnutls_ config_prefix != x ; then21 if test x${LIBGNUTLS_ CONFIG+set} != xset ; then22 LIBGNUTLS_ CONFIG=$libgnutls_config_prefix/bin/libgnutls-config20 if test x$libgnutls_extra_config_prefix != x ; then 21 if test x${LIBGNUTLS_EXTRA_CONFIG+set} != xset ; then 22 LIBGNUTLS_EXTRA_CONFIG=$libgnutls_extra_config_prefix/bin/libgnutls-extra-config 23 23 fi 24 24 fi 25 25 26 AC_PATH_PROG(LIBGNUTLS_ CONFIG, libgnutls-config, no)26 AC_PATH_PROG(LIBGNUTLS_EXTRA_CONFIG, libgnutls-extra-config, no) 27 27 min_libgnutls_version=ifelse([$1], ,0.1.0,$1) 28 28 AC_MSG_CHECKING(for libgnutls - version >= $min_libgnutls_version) 29 29 no_libgnutls="" 30 if test "$LIBGNUTLS_ CONFIG" = "no" ; then30 if test "$LIBGNUTLS_EXTRA_CONFIG" = "no" ; then 31 31 no_libgnutls=yes 32 32 else 33 LIBGNUTLS_ CFLAGS=`$LIBGNUTLS_CONFIG $libgnutls_config_args --cflags`34 LIBGNUTLS_ LIBS=`$LIBGNUTLS_CONFIG $libgnutls_config_args --libs`35 libgnutls_ config_version=`$LIBGNUTLS_CONFIG $libgnutls_config_args --version`33 LIBGNUTLS_EXTRA_CFLAGS=`$LIBGNUTLS_EXTRA_CONFIG $libgnutls_extra_config_args --cflags` 34 LIBGNUTLS_EXTRA_LIBS=`$LIBGNUTLS_EXTRA_CONFIG $libgnutls_extra_config_args --libs` 35 libgnutls_extra_config_version=`$LIBGNUTLS_EXTRA_CONFIG $libgnutls_extra_config_args --version` 36 36 37 37 38 38 ac_save_CFLAGS="$CFLAGS" 39 39 ac_save_LIBS="$LIBS" 40 CFLAGS="$CFLAGS $LIBGNUTLS_ CFLAGS"41 LIBS="$LIBS $LIBGNUTLS_ LIBS"40 CFLAGS="$CFLAGS $LIBGNUTLS_EXTRA_CFLAGS" 41 LIBS="$LIBS $LIBGNUTLS_EXTRA_LIBS" 42 42 dnl 43 43 dnl Now check if the installed libgnutls is sufficiently new. Also sanity 44 dnl checks the results of libgnutls- config to some extent44 dnl checks the results of libgnutls-extra-config to some extent 45 45 dnl 46 46 rm -f conf.libgnutlstest … … 49 49 #include <stdlib.h> 50 50 #include <string.h> 51 #include <gnutls/ gnutls.h>51 #include <gnutls/extra.h> 52 52 53 53 int … … 56 56 system ("touch conf.libgnutlstest"); 57 57 58 if( strcmp( gnutls_ check_version(NULL), "$libgnutls_config_version" ) )58 if( strcmp( gnutls_extra_check_version(NULL), "$libgnutls_extra_config_version" ) ) 59 59 { 60 printf("\n*** 'libgnutls- config --version' returned %s, but LIBGNUTLS(%s)\n",61 "$libgnutls_ config_version", gnutls_check_version(NULL) );62 printf("*** was found! If libgnutls- config was correct, then it is best\n");63 printf("*** to remove the old version of LIBGNUTLS . You may also be able to fix the error\n");60 printf("\n*** 'libgnutls-extra-config --version' returned %s, but LIBGNUTLS_EXTRA (%s)\n", 61 "$libgnutls_extra_config_version", gnutls_extra_check_version(NULL) ); 62 printf("*** was found! If libgnutls-extra-config was correct, then it is best\n"); 63 printf("*** to remove the old version of LIBGNUTLS_EXTRA. You may also be able to fix the error\n"); 64 64 printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); 65 65 printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); 66 66 printf("*** required on your system.\n"); 67 printf("*** If libgnutls- config was wrong, set the environment variable LIBGNUTLS_CONFIG\n");68 printf("*** to point to the correct copy of libgnutls- config, and remove the file config.cache\n");67 printf("*** If libgnutls-extra-config was wrong, set the environment variable LIBGNUTLS_EXTRA_CONFIG\n"); 68 printf("*** to point to the correct copy of libgnutls-extra-config, and remove the file config.cache\n"); 69 69 printf("*** before re-running configure\n"); 70 70 } 71 else if ( strcmp(gnutls_ check_version(NULL), LIBGNUTLS_VERSION ) )71 else if ( strcmp(gnutls_extra_check_version(NULL), LIBGNUTLS_EXTRA_VERSION ) ) 72 72 { 73 printf("\n*** LIBGNUTLS header file (version %s) does not match\n", LIBGNUTLS_VERSION); 74 printf("*** library (version %s)\n", gnutls_check_version(NULL) ); 73 printf("\n*** LIBGNUTLS_EXTRA header file (version %s) does not match\n", LIBGNUTLS_EXTRA_VERSION); 74 printf("*** library (version %s). This is may be due to a different version of gnutls\n", gnutls_extra_check_version(NULL) ); 75 printf("*** and gnutls-extra.\n"); 75 76 } 76 77 else 77 78 { 78 if ( gnutls_ check_version( "$min_libgnutls_version" ) )79 if ( gnutls_extra_check_version( "$min_libgnutls_version" ) ) 79 80 { 80 81 return 0; … … 82 83 else 83 84 { 84 printf("no\n*** An old version of LIBGNUTLS (%s) was found.\n",85 gnutls_ check_version(NULL) );86 printf("*** You need a version of LIBGNUTLS newer than %s. The latest version of\n",85 printf("no\n*** An old version of LIBGNUTLS_EXTRA (%s) was found.\n", 86 gnutls_extra_check_version(NULL) ); 87 printf("*** You need a version of LIBGNUTLS_EXTRA newer than %s. The latest version of\n", 87 88 "$min_libgnutls_version" ); 88 printf("*** LIBGNUTLS is always available from ftp://gnutls.hellug.gr/pub/gnutls.\n");89 printf("*** LIBGNUTLS_EXTRA is always available from ftp://gnutls.hellug.gr/pub/gnutls.\n"); 89 90 printf("*** \n"); 90 91 printf("*** If you have already installed a sufficiently new version, this error\n"); 91 printf("*** probably means that the wrong copy of the libgnutls- config shell script is\n");92 printf("*** probably means that the wrong copy of the libgnutls-extra-config shell script is\n"); 92 93 printf("*** being found. The easiest way to fix this is to remove the old version\n"); 93 printf("*** of LIBGNUTLS , but you can also set the LIBGNUTLS_CONFIG environment to point to the\n");94 printf("*** correct copy of libgnutls- config. (In this case, you will have to\n");94 printf("*** of LIBGNUTLS_EXTRA, but you can also set the LIBGNUTLS_EXTRA_CONFIG environment to point to the\n"); 95 printf("*** correct copy of libgnutls-extra-config. (In this case, you will have to\n"); 95 96 printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); 96 97 printf("*** so that the correct libraries are found at run-time))\n"); … … 113 114 AC_MSG_RESULT(no) 114 115 fi 115 if test "$LIBGNUTLS_ CONFIG" = "no" ; then116 echo "*** The libgnutls- config script installed by LIBGNUTLScould not be found"117 echo "*** If LIBGNUTLS was installed in PREFIX, make sure PREFIX/bin is in"118 echo "*** your path, or set the LIBGNUTLS_ CONFIG environment variable to the"119 echo "*** full path to libgnutls- config."116 if test "$LIBGNUTLS_EXTRA_CONFIG" = "no" ; then 117 echo "*** The libgnutls-extra-config script installed by LIBGNUTLS_EXTRA could not be found" 118 echo "*** If LIBGNUTLS_EXTRA was installed in PREFIX, make sure PREFIX/bin is in" 119 echo "*** your path, or set the LIBGNUTLS_EXTRA_CONFIG environment variable to the" 120 echo "*** full path to libgnutls-extra-config." 120 121 else 121 122 if test -f conf.libgnutlstest ; then … … 123 124 else 124 125 echo "*** Could not run libgnutls test program, checking why..." 125 CFLAGS="$CFLAGS $LIBGNUTLS_ CFLAGS"126 LIBS="$LIBS $LIBGNUTLS_ LIBS"126 CFLAGS="$CFLAGS $LIBGNUTLS_EXTRA_CFLAGS" 127 LIBS="$LIBS $LIBGNUTLS_EXTRA_LIBS" 127 128 AC_TRY_LINK([ 128 129 #include <stdio.h> 129 130 #include <stdlib.h> 130 131 #include <string.h> 131 #include <gnutls/ gnutls.h>132 ], [ return !!gnutls_ check_version(NULL); ],132 #include <gnutls/extra.h> 133 ], [ return !!gnutls_extra_check_version(NULL); ], 133 134 [ echo "*** The test program compiled, but did not run. This usually means" 134 echo "*** that the run-time linker is not finding LIBGNUTLS or finding the wrong"135 echo "*** version of LIBGNUTLS . If it is not finding LIBGNUTLS, you'll need to set your"135 echo "*** that the run-time linker is not finding LIBGNUTLS_EXTRA or finding the wrong" 136 echo "*** version of LIBGNUTLS_EXTRA. If it is not finding LIBGNUTLS_EXTRA, you'll need to set your" 136 137 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" 137 138 echo "*** to the installed location Also, make sure you have run ldconfig if that" … … 142 143 echo "***" ], 143 144 [ echo "*** The test program failed to compile or link. See the file config.log for the" 144 echo "*** exact error that occured. This usually means LIBGNUTLS was incorrectly installed"145 echo "*** or that you have moved LIBGNUTLS since it was installed. In the latter case, you"146 echo "*** may want to edit the libgnutls- config script: $LIBGNUTLS_CONFIG" ])145 echo "*** exact error that occured. This usually means LIBGNUTLS_EXTRA was incorrectly installed" 146 echo "*** or that you have moved LIBGNUTLS_EXTRA since it was installed. In the latter case, you" 147 echo "*** may want to edit the libgnutls-extra-config script: $LIBGNUTLS_EXTRA_CONFIG" ]) 147 148 CFLAGS="$ac_save_CFLAGS" 148 149 LIBS="$ac_save_LIBS" 149 150 fi 150 151 fi 151 LIBGNUTLS_ CFLAGS=""152 LIBGNUTLS_ LIBS=""152 LIBGNUTLS_EXTRA_CFLAGS="" 153 LIBGNUTLS_EXTRA_LIBS="" 153 154 ifelse([$3], , :, [$3]) 154 155 fi 155 156 rm -f conf.libgnutlstest 156 AC_SUBST(LIBGNUTLS_ CFLAGS)157 AC_SUBST(LIBGNUTLS_ LIBS)157 AC_SUBST(LIBGNUTLS_EXTRA_CFLAGS) 158 AC_SUBST(LIBGNUTLS_EXTRA_LIBS) 158 159 159 LIBGNUTLS_VERSION=`$LIBGNUTLS_CONFIG $libgnutls_config_args --version` 160 LIBGNUTLS_PREFIX="`$LIBGNUTLS_CONFIG $libgnutls_config_args --prefix`" 160 LIBGNUTLS_LIBS=$LIBGNUTLS_EXTRA_LIBS 161 LIBGNUTLS_CFLAGS=$LIBGNUTLS_EXTRA_CFLAGS 162 LIBGNUTLS_VERSION=`$LIBGNUTLS_EXTRA_CONFIG $libgnutls_extra_config_args --version` 163 LIBGNUTLS_PREFIX="`$LIBGNUTLS_EXTRA_CONFIG $libgnutls_extra_config_args --prefix`" 161 164 GNUTLS_CERTTOOL="${LIBGNUTLS_PREFIX}/bin/certtool" 162 165 … … 166 169 AC_SUBST(LIBGNUTLS_PREFIX) 167 170 AC_SUBST(LIBGNUTLS_CERTTOOL) 168 171 169 172 ]) 170 173 -
src/Makefile.in
r15ffe0b r2dd044f 143 143 LIBGNUTLS_CERTTOOL = @LIBGNUTLS_CERTTOOL@ 144 144 LIBGNUTLS_CFLAGS = @LIBGNUTLS_CFLAGS@ 145 LIBGNUTLS_CONFIG = @LIBGNUTLS_CONFIG@ 145 LIBGNUTLS_EXTRA_CFLAGS = @LIBGNUTLS_EXTRA_CFLAGS@ 146 LIBGNUTLS_EXTRA_CONFIG = @LIBGNUTLS_EXTRA_CONFIG@ 147 LIBGNUTLS_EXTRA_LIBS = @LIBGNUTLS_EXTRA_LIBS@ 146 148 LIBGNUTLS_LIBS = @LIBGNUTLS_LIBS@ 147 149 LIBGNUTLS_PREFIX = @LIBGNUTLS_PREFIX@ -
src/gnutls_config.c
r15ffe0b r2dd044f 1 1 /** 2 2 * Copyright 2004-2005 Paul Querna 3 * Copyright 2007 Nikos Mavrogiannopoulos 3 4 * 4 5 * Licensed under the Apache License, Version 2.0 (the "License"); … … 203 204 } 204 205 206 const char *mgs_set_pgpcert_file(cmd_parms * parms, void *dummy, 207 const char *arg) 208 { 209 int ret; 210 gnutls_datum_t data; 211 const char *file; 212 apr_pool_t *spool; 213 mgs_srvconf_rec *sc = 214 (mgs_srvconf_rec *) ap_get_module_config(parms->server-> 215 module_config, 216 &gnutls_module); 217 apr_pool_create(&spool, parms->pool); 218 219 file = ap_server_root_relative(spool, arg); 220 221 if (load_datum_from_file(spool, file, &data) != 0) { 222 return apr_psprintf(parms->pool, "GnuTLS: Error Reading " 223 "Certificate '%s'", file); 224 } 225 226 ret = gnutls_openpgp_crt_init( &sc->cert_pgp); 227 if (ret < 0) { 228 return apr_psprintf(parms->pool, "GnuTLS: Failed to Init " 229 "PGP Certificate: (%d) %s", ret, 230 gnutls_strerror(ret)); 231 } 232 233 ret = 234 gnutls_openpgp_crt_import(sc->cert_pgp, &data, GNUTLS_OPENPGP_FMT_BASE64); 235 if (ret < 0) { 236 return apr_psprintf(parms->pool, "GnuTLS: Failed to Import " 237 "PGP Certificate '%s': (%d) %s", file, ret, 238 gnutls_strerror(ret)); 239 } 240 241 apr_pool_destroy(spool); 242 return NULL; 243 } 244 245 const char *mgs_set_pgpkey_file(cmd_parms * parms, void *dummy, 246 const char *arg) 247 { 248 int ret; 249 gnutls_datum_t data; 250 const char *file; 251 apr_pool_t *spool; 252 mgs_srvconf_rec *sc = 253 (mgs_srvconf_rec *) ap_get_module_config(parms->server-> 254 module_config, 255 &gnutls_module); 256 apr_pool_create(&spool, parms->pool); 257 258 file = ap_server_root_relative(spool, arg); 259 260 if (load_datum_from_file(spool, file, &data) != 0) { 261 return apr_psprintf(parms->pool, "GnuTLS: Error Reading " 262 "Private Key '%s'", file); 263 } 264 265 ret = gnutls_openpgp_privkey_init(&sc->privkey_pgp); 266 if (ret < 0) { 267 return apr_psprintf(parms->pool, "GnuTLS: Failed to initialize" 268 ": (%d) %s", ret, gnutls_strerror(ret)); 269 } 270 271 ret = 272 gnutls_openpgp_privkey_import(sc->privkey_pgp, &data, 273 GNUTLS_OPENPGP_FMT_BASE64, NULL, 0); 274 if (ret != 0) { 275 return apr_psprintf(parms->pool, "GnuTLS: Failed to Import " 276 "PGP Private Key '%s': (%d) %s", file, ret, 277 gnutls_strerror(ret)); 278 } 279 apr_pool_destroy(spool); 280 return NULL; 281 } 282 283 205 284 #ifdef ENABLE_SRP 206 285 … … 355 434 } 356 435 436 const char *mgs_set_keyring_file(cmd_parms * parms, void *dummy, 437 const char *arg) 438 { 439 int rv; 440 const char *file; 441 apr_pool_t *spool; 442 gnutls_datum_t data; 443 444 mgs_srvconf_rec *sc = 445 (mgs_srvconf_rec *) ap_get_module_config(parms->server-> 446 module_config, 447 &gnutls_module); 448 apr_pool_create(&spool, parms->pool); 449 450 file = ap_server_root_relative(spool, arg); 451 452 if (load_datum_from_file(spool, file, &data) != 0) { 453 return apr_psprintf(parms->pool, "GnuTLS: Error Reading " 454 "Keyring File '%s'", file); 455 } 456 457 rv = gnutls_openpgp_keyring_init(&sc->pgp_list); 458 if (rv < 0) { 459 return apr_psprintf(parms->pool, "GnuTLS: Failed to initialize" 460 "keyring: (%d) %s", rv, gnutls_strerror(rv)); 461 } 462 463 rv = gnutls_openpgp_keyring_import(sc->pgp_list, &data, GNUTLS_OPENPGP_FMT_BASE64); 464 if (rv < 0) { 465 return apr_psprintf(parms->pool, "GnuTLS: Failed to load " 466 "Keyring File '%s': (%d) %s", file, rv, 467 gnutls_strerror(rv)); 468 } 469 470 apr_pool_destroy(spool); 471 return NULL; 472 } 473 357 474 const char *mgs_set_enabled(cmd_parms * parms, void *dummy, 358 475 const char *arg) -
src/gnutls_hooks.c
r15ffe0b r2dd044f 37 37 static int mgs_cert_verify(request_rec * r, mgs_handle_t * ctxt); 38 38 /* use side==0 for server and side==1 for client */ 39 static void mgs_add_common_cert_vars(request_rec * r, gnutls_x509_crt cert, 39 static void mgs_add_common_cert_vars(request_rec * r, gnutls_x509_crt_t cert, 40 int side, 41 int export_certificates_enabled); 42 static void mgs_add_common_pgpcert_vars(request_rec * r, gnutls_openpgp_crt_t cert, 40 43 int side, 41 44 int export_certificates_enabled); … … 69 72 #endif 70 73 74 if (gnutls_check_version(LIBGNUTLS_VERSION)==NULL) { 75 fprintf(stderr, "gnutls_check_version() failed. Required: gnutls-%s Found: gnutls-%s\n", 76 LIBGNUTLS_VERSION, gnutls_check_version(NULL)); 77 return -3; 78 } 79 71 80 ret = gnutls_global_init(); 72 if (ret < 0) /* FIXME: can we print here? */ 73 exit(ret); 81 if (ret < 0) { 82 fprintf(stderr, "gnutls_global_init: %s\n", gnutls_strerror(ret)); 83 return -3; 84 } 85 86 ret = gnutls_global_init_extra(); 87 if (ret < 0) { 88 fprintf(stderr, "gnutls_global_init_extra: %s\n", gnutls_strerror(ret)); 89 return -3; 90 } 74 91 75 92 apr_pool_cleanup_register(pconf, NULL, mgs_cleanup_pre_config, … … 83 100 gnutls_global_set_log_level(9); 84 101 gnutls_global_set_log_function(gnutls_debug_log_all); 102 apr_file_printf(debug_log_fp, "gnutls: %s\n", gnutls_check_version(NULL)); 85 103 #endif 86 104 87 105 return OK; 88 106 } 89 90 /* We don't support openpgp certificates, yet */91 const static int cert_type_prio[2] = { GNUTLS_CRT_X509, 0 };92 107 93 108 static int mgs_select_virtual_server_cb(gnutls_session_t session) … … 96 111 mgs_srvconf_rec *tsc; 97 112 int ret; 113 int cprio[2]; 98 114 99 115 ctxt = gnutls_transport_get_ptr(session); … … 129 145 */ 130 146 ret = gnutls_priority_set(session, ctxt->sc->priorities); 131 gnutls_certificate_type_set_priority(session, cert_type_prio);132 133 134 147 /* actually it shouldn't fail since we have checked at startup */ 135 148 if (ret < 0) 136 149 return ret; 137 150 151 /* If both certificate types are not present disallow them from 152 * being negotiated. 153 */ 154 if (ctxt->sc->certs_x509[0] != NULL && ctxt->sc->cert_pgp == NULL) { 155 cprio[0] = GNUTLS_CRT_X509; 156 cprio[1] = 0; 157 gnutls_certificate_type_set_priority( session, cprio); 158 } else if (ctxt->sc->cert_pgp != NULL && ctxt->sc->certs_x509[0]==NULL) { 159 cprio[0] = GNUTLS_CRT_OPENPGP; 160 cprio[1] = 0; 161 gnutls_certificate_type_set_priority( session, cprio); 162 } 138 163 139 164 return 0; … … 146 171 ctxt = gnutls_transport_get_ptr(session); 147 172 148 ret->type = GNUTLS_CRT_X509; 149 ret->ncerts = ctxt->sc->certs_x509_num; 150 ret->deinit_all = 0; 151 152 ret->cert.x509 = ctxt->sc->certs_x509; 153 ret->key.x509 = ctxt->sc->privkey_x509; 154 return 0; 155 } 156 173 if (gnutls_certificate_type_get( session) == GNUTLS_CRT_X509) { 174 ret->type = GNUTLS_CRT_X509; 175 ret->ncerts = ctxt->sc->certs_x509_num; 176 ret->deinit_all = 0; 177 178 ret->cert.x509 = ctxt->sc->certs_x509; 179 ret->key.x509 = ctxt->sc->privkey_x509; 180 181 return 0; 182 } else if (gnutls_certificate_type_get( session) == GNUTLS_CRT_OPENPGP) { 183 ret->type = GNUTLS_CRT_OPENPGP; 184 ret->ncerts = 1; 185 ret->deinit_all = 0; 186 187 ret->cert.pgp = ctxt->sc->cert_pgp; 188 ret->key.pgp = ctxt->sc->privkey_pgp; 189 190 return 0; 191 192 } 193 194 return GNUTLS_E_INTERNAL_ERROR; 195 } 196 197 /* 2048-bit group parameters from SRP specification */ 157 198 const char static_dh_params[] = "-----BEGIN DH PARAMETERS-----\n" 158 199 "MIIBBwKCAQCsa9tBMkqam/Fm3l4TiVgvr3K2ZRmH7gf8MZKUPbVgUKNzKcu0oJnt\n" … … 170 211 */ 171 212 static int read_crt_cn(server_rec * s, apr_pool_t * p, 172 gnutls_x509_crt cert, char **cert_cn)213 gnutls_x509_crt_t cert, char **cert_cn) 173 214 { 174 215 int rv = 0, i; … … 178 219 *cert_cn = NULL; 179 220 221 data_len = 0; 180 222 rv = gnutls_x509_crt_get_dn_by_oid(cert, 181 223 GNUTLS_OID_X520_COMMON_NAME, … … 188 230 0, *cert_cn, &data_len); 189 231 } else { /* No CN return subject alternative name */ 190 ap_log_error(APLOG_MARK, APLOG_ INFO, 0, s,191 "No common name found in certificate for '%s:%d'. Looking for subject alternative name. ",232 ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s, 233 "No common name found in certificate for '%s:%d'. Looking for subject alternative name...", 192 234 s->server_hostname, s->port); 193 235 rv = 0; … … 217 259 218 260 return rv; 219 220 } 261 } 262 263 static int read_pgpcrt_cn(server_rec * s, apr_pool_t * p, 264 gnutls_openpgp_crt_t cert, char **cert_cn) 265 { 266 int rv = 0; 267 size_t data_len; 268 269 270 *cert_cn = NULL; 271 272 data_len = 0; 273 rv = gnutls_openpgp_crt_get_name(cert, 0, NULL, &data_len); 274 275 if (rv == GNUTLS_E_SHORT_MEMORY_BUFFER && data_len > 1) { 276 *cert_cn = apr_palloc(p, data_len); 277 rv = gnutls_openpgp_crt_get_name(cert, 0, *cert_cn, &data_len); 278 } else { /* No CN return subject alternative name */ 279 ap_log_error(APLOG_MARK, APLOG_INFO, 0, s, 280 "No name found in PGP certificate for '%s:%d'.", 281 s->server_hostname, s->port); 282 } 283 284 return rv; 285 } 286 221 287 222 288 int … … 355 421 if (sc->enabled == GNUTLS_ENABLED_TRUE) { 356 422 rv = read_crt_cn(s, p, sc->certs_x509[0], &sc->cert_cn); 423 if (rv < 0 && sc->cert_pgp != NULL) /* try openpgp certificate */ 424 rv = read_pgpcrt_cn(s, p, sc->cert_pgp, &sc->cert_cn); 425 357 426 if (rv < 0) { 358 427 ap_log_error(APLOG_MARK, APLOG_EMERG, 0, s, … … 483 552 ctxt = gnutls_transport_get_ptr(session); 484 553 485 sni_type = gnutls_certificate_type_get(session);486 if (sni_type != GNUTLS_CRT_X509) {487 /* In theory, we could support OpenPGP Certificates. Theory != code. */488 ap_log_error(APLOG_MARK, APLOG_CRIT, 0,489 ctxt->c->base_server,490 "GnuTLS: Only x509 Certificates are currently supported.");491 return NULL;492 }493 494 554 rv = gnutls_server_name_get(ctxt->session, sni_name, 495 555 &data_len, &sni_type, 0); … … 691 751 apr_table_setn(env, "SSL_SESSION_ID", apr_pstrdup(r->pool, tmp)); 692 752 693 mgs_add_common_cert_vars(r, ctxt->sc->certs_x509[0], 0, 753 if (gnutls_certificate_type_get( ctxt->session) == GNUTLS_CRT_X509) 754 mgs_add_common_cert_vars(r, ctxt->sc->certs_x509[0], 0, 755 ctxt->sc->export_certificates_enabled); 756 else if (gnutls_certificate_type_get( ctxt->session) == GNUTLS_CRT_OPENPGP) 757 mgs_add_common_pgpcert_vars(r, ctxt->sc->cert_pgp, 0, 694 758 ctxt->sc->export_certificates_enabled); 695 759 … … 753 817 #define MGS_SIDE ((side==0)?"SSL_SERVER":"SSL_CLIENT") 754 818 static void 755 mgs_add_common_cert_vars(request_rec * r, gnutls_x509_crt cert, int side,819 mgs_add_common_cert_vars(request_rec * r, gnutls_x509_crt_t cert, int side, 756 820 int export_certificates_enabled) 757 821 { … … 859 923 } 860 924 } 861 862 863 } 864 865 925 } 926 927 static void 928 mgs_add_common_pgpcert_vars(request_rec * r, gnutls_openpgp_crt_t cert, int side, 929 int export_certificates_enabled) 930 { 931 unsigned char sbuf[64]; /* buffer to hold serials */ 932 char buf[AP_IOBUFSIZE]; 933 const char *tmp; 934 size_t len; 935 int ret; 936 937 apr_table_t *env = r->subprocess_env; 938 939 if (export_certificates_enabled != 0) { 940 char cert_buf[10 * 1024]; 941 len = sizeof(cert_buf); 942 943 if (gnutls_openpgp_crt_export 944 (cert, GNUTLS_OPENPGP_FMT_BASE64, cert_buf, &len) >= 0) 945 apr_table_setn(env, 946 apr_pstrcat(r->pool, MGS_SIDE, "_CERT", NULL), 947 apr_pstrmemdup(r->pool, cert_buf, len)); 948 949 } 950 951 len = sizeof(buf); 952 gnutls_openpgp_crt_get_name(cert, 0, buf, &len); 953 apr_table_setn(env, apr_pstrcat(r->pool, MGS_SIDE, "_NAME", NULL), 954 apr_pstrmemdup(r->pool, buf, len)); 955 956 len = sizeof(sbuf); 957 gnutls_openpgp_crt_get_fingerprint(cert, sbuf, &len); 958 tmp = mgs_session_id2sz(sbuf, len, buf, sizeof(buf)); 959 apr_table_setn(env, apr_pstrcat(r->pool, MGS_SIDE, "_FINGERPRINT", NULL), 960 apr_pstrdup(r->pool, tmp)); 961 962 ret = gnutls_openpgp_crt_get_version(cert); 963 if (ret > 0) 964 apr_table_setn(env, 965 apr_pstrcat(r->pool, MGS_SIDE, "_M_VERSION", NULL), 966 apr_psprintf(r->pool, "%u", ret)); 967 968 apr_table_setn(env, 969 apr_pstrcat(r->pool, MGS_SIDE, "_CERT_TYPE", NULL), "OPENPGP"); 970 971 tmp = 972 mgs_time2sz(gnutls_openpgp_crt_get_expiration_time 973 (cert), buf, sizeof(buf)); 974 apr_table_setn(env, apr_pstrcat(r->pool, MGS_SIDE, "_V_END", NULL), 975 apr_pstrdup(r->pool, tmp)); 976 977 tmp = 978 mgs_time2sz(gnutls_openpgp_crt_get_creation_time 979 (cert), buf, sizeof(buf)); 980 apr_table_setn(env, apr_pstrcat(r->pool, MGS_SIDE, "_V_START", NULL), 981 apr_pstrdup(r->pool, tmp)); 982 983 ret = gnutls_openpgp_crt_get_pk_algorithm(cert, NULL); 984 if (ret >= 0) { 985 apr_table_setn(env, apr_pstrcat(r->pool, MGS_SIDE, "_A_KEY", NULL), 986 gnutls_pk_algorithm_get_name(ret)); 987 } 988 989 } 990 991 /* TODO: Allow client sending a X.509 certificate chain */ 866 992 static int mgs_cert_verify(request_rec * r, mgs_handle_t * ctxt) 867 993 { … … 869 995 unsigned int cert_list_size, status, expired; 870 996 int rv, ret; 871 gnutls_x509_crt_t cert; 997 union { 998 gnutls_x509_crt_t x509; 999 gnutls_openpgp_crt_t pgp; 1000 } cert; 872 1001 apr_time_t activation_time, expiration_time, cur_time; 873 1002 … … 895 1024 } 896 1025 897 gnutls_x509_crt_init(&cert); 898 rv = gnutls_x509_crt_import(cert, &cert_list[0], GNUTLS_X509_FMT_DER); 1026 if (gnutls_certificate_type_get( ctxt->session) == GNUTLS_CRT_X509) { 1027 gnutls_x509_crt_init(&cert.x509); 1028 rv = gnutls_x509_crt_import(cert.x509, &cert_list[0], GNUTLS_X509_FMT_DER); 1029 } else if (gnutls_certificate_type_get( ctxt->session) == GNUTLS_CRT_OPENPGP) { 1030 gnutls_openpgp_crt_init(&cert.pgp); 1031 rv = gnutls_openpgp_crt_import(cert.pgp, &cert_list[0], GNUTLS_OPENPGP_FMT_RAW); 1032 } else return HTTP_FORBIDDEN; 1033 899 1034 if (rv < 0) { 900 1035 ap_log_rerror(APLOG_MARK, APLOG_INFO, 0, r, 901 1036 "GnuTLS: Failed to Verify Peer: " 902 1037 "Failed to import peer certificates."); 903 ret = HTTP_FORBIDDEN; 904 goto exit; 905 } 906 907 apr_time_ansi_put(&expiration_time, 908 gnutls_x509_crt_get_expiration_time(cert)); 909 apr_time_ansi_put(&activation_time, 910 gnutls_x509_crt_get_activation_time(cert)); 911 912 rv = gnutls_x509_crt_verify(cert, ctxt->sc->ca_list, 1038 ret = HTTP_FORBIDDEN; 1039 goto exit; 1040 } 1041 1042 if (gnutls_certificate_type_get( ctxt->session) == GNUTLS_CRT_X509) { 1043 apr_time_ansi_put(&expiration_time, 1044 gnutls_x509_crt_get_expiration_time(cert.x509)); 1045 apr_time_ansi_put(&activation_time, 1046 gnutls_x509_crt_get_activation_time(cert.x509)); 1047 1048 rv = gnutls_x509_crt_verify(cert.x509, ctxt->sc->ca_list, 913 1049 ctxt->sc->ca_list_size, 0, &status); 1050 } else { 1051 apr_time_ansi_put(&expiration_time, 1052 gnutls_openpgp_crt_get_expiration_time(cert.pgp)); 1053 apr_time_ansi_put(&activation_time, 1054 gnutls_openpgp_crt_get_creation_time(cert.pgp)); 1055 1056 rv = gnutls_openpgp_crt_verify_ring(cert.pgp, ctxt->sc->pgp_list, 1057 0, &status); 1058 } 914 1059 915 1060 if (rv < 0) { … … 917 1062 "GnuTLS: Failed to Verify Peer certificate: (%d) %s", 918 1063 rv, gnutls_strerror(rv)); 1064 if (rv == GNUTLS_E_NO_CERTIFICATE_FOUND) 1065 ap_log_rerror(APLOG_MARK, APLOG_EMERG, 0, r, 1066 "GnuTLS: No certificate was found for verification. Did you set the GnuTLSX509CAFile or GnuTLSPGPKeyringFile directives?"); 919 1067 ret = HTTP_FORBIDDEN; 920 1068 goto exit; 921 1069 } 1070 1071 /* TODO: X509 CRL Verification. */ 1072 /* May add later if anyone needs it. 1073 */ 1074 /* ret = gnutls_x509_crt_check_revocation(crt, crl_list, crl_list_size); */ 922 1075 923 1076 expired = 0; … … 955 1108 } 956 1109 957 /* TODO: Further Verification. */ 958 /* Revocation is X.509 non workable paradigm, I really doubt implementation 959 * is worth doing --nmav 960 */ 961 /// ret = gnutls_x509_crt_check_revocation(crt, crl_list, crl_list_size); 962 963 // mgs_hook_fixups(r); 964 // rv = mgs_authz_lua(r); 965 966 mgs_add_common_cert_vars(r, cert, 1, 1110 if (gnutls_certificate_type_get( ctxt->session) == GNUTLS_CRT_X509) 1111 mgs_add_common_cert_vars(r, cert.x509, 1, 1112 ctxt->sc->export_certificates_enabled); 1113 else if (gnutls_certificate_type_get( ctxt->session) == GNUTLS_CRT_OPENPGP) 1114 mgs_add_common_pgpcert_vars(r, cert.pgp, 1, 967 1115 ctxt->sc->export_certificates_enabled); 968 1116 … … 988 1136 989 1137 exit: 990 gnutls_x509_crt_deinit(cert); 1138 if (gnutls_certificate_type_get( ctxt->session) == GNUTLS_CRT_X509) 1139 gnutls_x509_crt_deinit(cert.x509); 1140 else if (gnutls_certificate_type_get( ctxt->session) == GNUTLS_CRT_OPENPGP) 1141 gnutls_openpgp_crt_deinit(cert.pgp); 991 1142 return ret; 992 1143 -
src/mod_gnutls.c
r15ffe0b r2dd044f 64 64 RSRC_CONF, 65 65 "Set the CA File to verify Client Certificates"), 66 AP_INIT_TAKE1("GnuTLSX509CAFile", mgs_set_client_ca_file, 67 NULL, 68 RSRC_CONF, 69 "Set the CA File to verify Client Certificates"), 70 AP_INIT_TAKE1("GnuTLSPGPKeyringFile", mgs_set_keyring_file, 71 NULL, 72 RSRC_CONF, 73 "Set the Keyring File to verify Client Certificates"), 66 74 AP_INIT_TAKE1("GnuTLSDHFile", mgs_set_dh_file, 67 75 NULL, … … 75 83 NULL, 76 84 RSRC_CONF, 77 "SSL Server Keyfile"),85 "SSL Server X509 Certificate file"), 78 86 AP_INIT_TAKE1("GnuTLSKeyFile", mgs_set_key_file, 79 87 NULL, 80 88 RSRC_CONF, 81 "SSL Server SRP Password file"), 89 "SSL Server X509 Private Key file"), 90 AP_INIT_TAKE1("GnuTLSX509CertificateFile", mgs_set_cert_file, 91 NULL, 92 RSRC_CONF, 93 "SSL Server X509 Certificate file"), 94 AP_INIT_TAKE1("GnuTLSX509KeyFile", mgs_set_key_file, 95 NULL, 96 RSRC_CONF, 97 "SSL Server X509 Private Key file"), 98 AP_INIT_TAKE1("GnuTLSPGPCertificateFile", mgs_set_pgpcert_file, 99 NULL, 100 RSRC_CONF, 101 "SSL Server PGP Certificate file"), 102 AP_INIT_TAKE1("GnuTLSPGPKeyFile", mgs_set_pgpkey_file, 103 NULL, 104 RSRC_CONF, 105 "SSL Server PGP Private key file"), 82 106 #ifdef ENABLE_SRP 83 107 AP_INIT_TAKE1("GnuTLSSRPPasswdFile", mgs_set_srp_tpasswd_file,
Note: See TracChangeset
for help on using the changeset viewer.