summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorAlexander Barton <alex@barton.de>2008-11-11 22:03:11 +0100
committerAlexander Barton <alex@barton.de>2008-11-11 22:03:11 +0100
commit3a5b7b63ae493aeff7b6ec85ebbfbc39202d0bc4 (patch)
treeac5ded7c18b47cc616d212e3e3a8b1eeb022ff6b /src
parent9308541e6df05d141ea51125877239e01ee5a1f5 (diff)
downloadngircd-3a5b7b63ae493aeff7b6ec85ebbfbc39202d0bc4.tar.gz
ngircd-3a5b7b63ae493aeff7b6ec85ebbfbc39202d0bc4.zip
GNUTLS: define new API types when installed library is too old
This patch enables ngIRCd to use GNUTLS in really old versions, tested
with version 1.0.16, that don't define the "new" data types ending in
xxx_t. LIBGNUTLS_VERSION_MAJOR isn't defined there as well, so we use
it to test if we must define the new types on our own.
Diffstat (limited to 'src')
-rw-r--r--src/ngircd/conf-ssl.h16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/ngircd/conf-ssl.h b/src/ngircd/conf-ssl.h
index 35ba28f4..e88d3e89 100644
--- a/src/ngircd/conf-ssl.h
+++ b/src/ngircd/conf-ssl.h
@@ -13,6 +13,14 @@
 #ifdef HAVE_LIBGNUTLS
 #define SSL_SUPPORT
 #include <gnutls/gnutls.h>
+#ifndef LIBGNUTLS_VERSION_MAJOR
+#define gnutls_certificate_credentials_t gnutls_certificate_credentials
+#define gnutls_cipher_algorithm_t gnutls_cipher_algorithm
+#define gnutls_datum_t gnutls_datum
+#define gnutls_dh_params_t gnutls_dh_params
+#define gnutls_session_t gnutls_session
+#define gnutls_transport_ptr_t gnutls_transport_ptr
+#endif
 #endif
 
 #ifdef SSL_SUPPORT
@@ -21,17 +29,19 @@ struct ConnSSL_State {
 	SSL *ssl;
 #endif
 #ifdef HAVE_LIBGNUTLS
-	gnutls_session_t gnutls_session;
-	void *cookie;	/* pointer to server configuration structure (for outgoing connections), or NULL. */
+	gnutls_session gnutls_session;
+	void *cookie;		/* pointer to server configuration structure
+				   (for outgoing connections), or NULL. */
 #endif
 };
 
-
 bool
 ConnSSL_InitLibrary(void);
 #else
 static inline bool
 ConnSSL_InitLibrary(void) { return true; }
 #endif /* SSL_SUPPORT */
+
 #endif /* conf_ssl_h */
+
 /* -eof- */