#define GNUTLS_NEW_PRIO_API
#endif
-#if (!INSPIRCD_GNUTLS_HAS_VERSION(2, 0, 0))
-typedef gnutls_certificate_credentials_t gnutls_certificate_credentials;
-typedef gnutls_dh_params_t gnutls_dh_params;
-#endif
-
enum issl_status { ISSL_NONE, ISSL_HANDSHAKING, ISSL_HANDSHAKEN };
#if INSPIRCD_GNUTLS_HAS_VERSION(2, 12, 0)
static Module* thismod;
-class RandGen : public HandlerBase2<void, char*, size_t>
+class RandGen
{
public:
- void Call(char* buffer, size_t len) CXX11_OVERRIDE
+ static void Call(char* buffer, size_t len)
{
#ifdef GNUTLS_HAS_RND
gnutls_rnd(GNUTLS_RND_RANDOM, buffer, len);
, keystr(ReadFile(tag->getString("keyfile", "key.pem")))
, dh(DHParams::Import(ReadFile(tag->getString("dhfile", "dhparams.pem"))))
, priostr(GetPrioStr(profilename, tag))
- , mindh(tag->getInt("mindhbits", 1024))
+ , mindh(tag->getUInt("mindhbits", 1024))
, hashstr(tag->getString("hash", "md5"))
, requestclientcert(tag->getBool("requestclientcert", true))
{
#ifdef INSPIRCD_GNUTLS_HAS_CORK
// If cork support is available outrecsize represents the (rough) max amount of data we give GnuTLS while corked
- outrecsize = tag->getInt("outrecsize", 2048, 512);
+ outrecsize = tag->getUInt("outrecsize", 2048, 512);
#else
- outrecsize = tag->getInt("outrecsize", 2048, 512, 16384);
+ outrecsize = tag->getUInt("outrecsize", 2048, 512, 16384);
#endif
}
};
// First member of the class, gets constructed first and destructed last
GnuTLS::Init libinit;
- RandGen randhandler;
ProfileList profiles;
void ReadProfiles()
{
ServerInstance->Logs->Log(MODNAME, LOG_DEFAULT, "GnuTLS lib version %s module was compiled for " GNUTLS_VERSION, gnutls_check_version(NULL));
ReadProfiles();
- ServerInstance->GenRandom = &randhandler;
+ ServerInstance->GenRandom = RandGen::Call;
}
void OnModuleRehash(User* user, const std::string ¶m) CXX11_OVERRIDE
~ModuleSSLGnuTLS()
{
- ServerInstance->GenRandom = &ServerInstance->HandleGenRandom;
+ ServerInstance->GenRandom = &InspIRCd::DefaultGenRandom;
}
void OnCleanup(ExtensionItem::ExtensibleType type, Extensible* item) CXX11_OVERRIDE