]> arthur.barton.de Git - ngircd-alex.git/blob - src/ngircd/conf-ssl.h
cdb996828c4b0e68dd8e0f8ce01823e254bda953
[ngircd-alex.git] / src / ngircd / conf-ssl.h
1 /*
2  * ngIRCd -- The Next Generation IRC Daemon
3  * SSL defines.
4  */
5
6 #ifndef conf_ssl_h
7 #define conf_ssl_h
8
9 #ifdef HAVE_LIBSSL
10 #define SSL_SUPPORT
11 #include <openssl/ssl.h>
12 #endif
13 #ifdef HAVE_LIBGNUTLS
14 #define SSL_SUPPORT
15 #include <gnutls/gnutls.h>
16 #ifndef LIBGNUTLS_VERSION_MAJOR
17 #define gnutls_certificate_credentials_t gnutls_certificate_credentials
18 #define gnutls_cipher_algorithm_t gnutls_cipher_algorithm
19 #define gnutls_datum_t gnutls_datum
20 #define gnutls_dh_params_t gnutls_dh_params
21 #define gnutls_session_t gnutls_session
22 #define gnutls_transport_ptr_t gnutls_transport_ptr
23 #endif
24 #endif
25
26 #ifdef SSL_SUPPORT
27 struct ConnSSL_State {
28 #ifdef HAVE_LIBSSL
29         SSL *ssl;
30 #endif
31 #ifdef HAVE_LIBGNUTLS
32         gnutls_session gnutls_session;
33         void *cookie;           /* pointer to server configuration structure
34                                    (for outgoing connections), or NULL. */
35 #endif
36 };
37
38 bool
39 ConnSSL_InitLibrary(void);
40 #else
41 static inline bool
42 ConnSSL_InitLibrary(void)
43 { return true; }
44 #endif /* SSL_SUPPORT */
45
46 #endif /* conf_ssl_h */
47
48 /* -eof- */