conf-ssl.h 957 B

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