conf-ssl.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. #if OPENSSL_VERSION_NUMBER < 0x10100000L
  14. #define OpenSSL_version SSLeay_version
  15. #define OPENSSL_VERSION SSLEAY_VERSION
  16. #endif
  17. #endif
  18. #ifdef HAVE_LIBGNUTLS
  19. #define SSL_SUPPORT
  20. #include <gnutls/gnutls.h>
  21. #ifndef LIBGNUTLS_VERSION_MAJOR
  22. #define gnutls_certificate_credentials_t gnutls_certificate_credentials
  23. #define gnutls_cipher_algorithm_t gnutls_cipher_algorithm
  24. #define gnutls_datum_t gnutls_datum
  25. #define gnutls_dh_params_t gnutls_dh_params
  26. #define gnutls_session_t gnutls_session
  27. #define gnutls_transport_ptr_t gnutls_transport_ptr
  28. #endif
  29. #endif
  30. #ifdef SSL_SUPPORT
  31. struct ConnSSL_State {
  32. #ifdef HAVE_LIBSSL
  33. SSL *ssl;
  34. #endif
  35. #ifdef HAVE_LIBGNUTLS
  36. gnutls_session_t gnutls_session;
  37. void *cookie; /* pointer to server configuration structure
  38. (for outgoing connections), or NULL. */
  39. #endif
  40. char *fingerprint;
  41. };
  42. #endif
  43. GLOBAL bool ConnSSL_InitLibrary PARAMS((void));
  44. #endif /* conf_ssl_h */
  45. /* -eof- */