]> ruderich.org/simon Gitweb - tlsproxy/tlsproxy.git/commitdiff
Fix compile with current GnuTLS versions.
authorSimon Ruderich <simon@ruderich.org>
Tue, 6 Aug 2013 02:24:14 +0000 (04:24 +0200)
committerSimon Ruderich <simon@ruderich.org>
Tue, 6 Aug 2013 02:24:14 +0000 (04:24 +0200)
src/tlsproxy.c

index 0257d6788f79d121832a04117e67b98a95ce84ad..40729f08c8240938ea24dca75597a96115c2c474 100644 (file)
 #include <sys/types.h>
 #include <unistd.h>
 
+#if GNUTLS_VERSION_NUMBER <= 0x020b00
 /* Necessary for GnuTLS when used with threads. */
 #include <gcrypt.h>
 GCRY_THREAD_OPTION_PTHREAD_IMPL;
+#endif
 
 
 /* Size of ringbuffer. */
@@ -364,6 +366,9 @@ static void print_usage(const char *argv) {
 
 static void initialize_gnutls(void) {
     int result;
+/* Recent versions of GnuTLS automatically initialize the cryptography layer
+ * in gnutls_global_init(). */
+#if GNUTLS_VERSION_NUMBER <= 0x020b00
     gcry_error_t error;
 
     /* Thread safe setup. Must be called before gnutls_global_init(). */
@@ -380,6 +385,7 @@ static void initialize_gnutls(void) {
                                                    gcry_strerror(error));
         exit(EXIT_FAILURE);
     }
+#endif
 
     /* Initialize GnuTLS. */
     result = gnutls_global_init();