conf-ssl.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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. size_t x509_cred_idx; /* index of active x509 credential record */
  40. #endif
  41. char *fingerprint;
  42. };
  43. #endif
  44. GLOBAL bool ConnSSL_InitLibrary PARAMS((void));
  45. #endif /* conf_ssl_h */
  46. /* -eof- */