conf-ssl.h 1011 B

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