r8482: gnutls_x509_crt_set_subject_key_id is not available in some versions
authorAndrew Tridgell <tridge@samba.org>
Fri, 15 Jul 2005 07:00:12 +0000 (07:00 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:23:08 +0000 (13:23 -0500)
of gnutls. Thanks to ab for spotting this.
(This used to be commit 437c4057ae4e89725ddbdd026977510beb33c009)

source4/configure.in
source4/lib/tls/config.m4 [new file with mode: 0644]
source4/lib/tls/tlscert.c
source4/web_server/config.m4

index 587f220d19104ecd1fc4a5424c7ad616dfcf78c8..11bcc1211b0d974c1a2e950148e2a1e4e3a4cacf 100644 (file)
@@ -19,6 +19,7 @@ sinclude(lib/talloc/config.m4)
 sinclude(lib/tdb/config.m4)
 sinclude(lib/ldb/sqlite3.m4)
 sinclude(lib/ldb/config.m4)
+sinclude(lib/tls/config.m4)
 sinclude(lib/events/config.m4)
 sinclude(lib/cmdline/config.m4)
 
diff --git a/source4/lib/tls/config.m4 b/source4/lib/tls/config.m4
new file mode 100644 (file)
index 0000000..6ad6186
--- /dev/null
@@ -0,0 +1,16 @@
+###############################
+# start SMB_EXT_LIB_GNUTLS
+# check for gnutls/gnutls.h and -lgnutls
+AC_CHECK_HEADERS(gnutls/gnutls.h)
+AC_CHECK_LIB_EXT(gnutls, GNUTLS_LIBS, gnutls_global_init)
+if test x"$ac_cv_header_gnutls_gnutls_h" = x"yes" -a x"$ac_cv_lib_ext_gnutls_gnutls_global_init" = x"yes";then
+       SMB_EXT_LIB_ENABLE(GNUTLS,YES)
+       AC_CHECK_DECL(gnutls_x509_crt_set_subject_key_id,  
+                     [AC_DEFINE(HAVE_GNUTLS_X509_CRT_SET_SUBJECT_KEY_ID,1,gnutls subject_key)], [], [
+#include <gnutls/gnutls.h>
+#include <gnutls/x509.h>
+])
+fi
+SMB_EXT_LIB(GNUTLS, $GNUTLS_LIBS)
+# end SMB_EXT_LIB_GNUTLS
+###############################
index 2cd46ff4329b80e79c23bc59a250b6ece1b2de53..d1199226029cd1f434445bda53714104635144e4 100644 (file)
@@ -94,7 +94,9 @@ void tls_cert_generate(TALLOC_CTX *mem_ctx,
 #endif
        TLSCHECK(gnutls_x509_crt_set_version(cacrt, 3));
        TLSCHECK(gnutls_x509_crt_get_key_id(cacrt, 0, keyid, &keyidsize));
+#if HAVE_GNUTLS_X509_CRT_SET_SUBJECT_KEY_ID
        TLSCHECK(gnutls_x509_crt_set_subject_key_id(cacrt, keyid, keyidsize));
+#endif
        TLSCHECK(gnutls_x509_crt_sign(cacrt, cacrt, cakey));
 
        DEBUG(3,("Generating TLS certificate\n"));
@@ -118,7 +120,9 @@ void tls_cert_generate(TALLOC_CTX *mem_ctx,
 #endif
        TLSCHECK(gnutls_x509_crt_set_version(crt, 3));
        TLSCHECK(gnutls_x509_crt_get_key_id(crt, 0, keyid, &keyidsize));
+#if HAVE_GNUTLS_X509_CRT_SET_SUBJECT_KEY_ID
        TLSCHECK(gnutls_x509_crt_set_subject_key_id(crt, keyid, keyidsize));
+#endif
        TLSCHECK(gnutls_x509_crt_sign(crt, crt, key));
 
        DEBUG(3,("Exporting TLS keys\n"));
index 057f193179de59623fe67002376744c782797eb0..2dd5e5b823a7d5053e602f311ef0e1a3e0c249b4 100644 (file)
@@ -1,13 +1,2 @@
 AC_CHECK_HEADERS(setjmp.h)
 
-###############################
-# start SMB_EXT_LIB_GNUTLS
-# check for gnutls/gnutls.h and -lgnutls
-AC_CHECK_HEADERS(gnutls/gnutls.h)
-AC_CHECK_LIB_EXT(gnutls, GNUTLS_LIBS, gnutls_global_init)
-if test x"$ac_cv_header_gnutls_gnutls_h" = x"yes" -a x"$ac_cv_lib_ext_gnutls_gnutls_global_init" = x"yes";then
-       SMB_EXT_LIB_ENABLE(GNUTLS,YES)
-fi
-SMB_EXT_LIB(GNUTLS, $GNUTLS_LIBS)
-# end SMB_EXT_LIB_GNUTLS
-###############################