mirror of
https://github.com/inspircd/inspircd.git
synced 2025-03-10 11:09:04 -04:00
Add a subclass of IOHookProvider for SSL modules.
This commit is contained in:
parent
a670bd81f6
commit
6c2b6fa23d
@ -151,6 +151,16 @@ class ssl_cert : public refcountbase
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/** I/O hook provider for SSL modules. */
|
||||||
|
class SSLIOHookProvider : public IOHookProvider
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
SSLIOHookProvider(Module* mod, const std::string& Name)
|
||||||
|
: IOHookProvider(mod, "ssl/" + Name, IOH_SSL)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
class SSLIOHook : public IOHook
|
class SSLIOHook : public IOHook
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
|
@ -1243,13 +1243,13 @@ int GnuTLS::X509Credentials::cert_callback(gnutls_session_t sess, const gnutls_d
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
class GnuTLSIOHookProvider : public IOHookProvider
|
class GnuTLSIOHookProvider : public SSLIOHookProvider
|
||||||
{
|
{
|
||||||
GnuTLS::Profile profile;
|
GnuTLS::Profile profile;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
GnuTLSIOHookProvider(Module* mod, GnuTLS::Profile::Config& config)
|
GnuTLSIOHookProvider(Module* mod, GnuTLS::Profile::Config& config)
|
||||||
: IOHookProvider(mod, "ssl/" + config.name, IOHookProvider::IOH_SSL)
|
: SSLIOHookProvider(mod, config.name)
|
||||||
, profile(config)
|
, profile(config)
|
||||||
{
|
{
|
||||||
ServerInstance->Modules->AddService(*this);
|
ServerInstance->Modules->AddService(*this);
|
||||||
|
@ -817,13 +817,13 @@ class mbedTLSIOHook : public SSLIOHook
|
|||||||
bool IsHandshakeDone() const { return (status == ISSL_HANDSHAKEN); }
|
bool IsHandshakeDone() const { return (status == ISSL_HANDSHAKEN); }
|
||||||
};
|
};
|
||||||
|
|
||||||
class mbedTLSIOHookProvider : public IOHookProvider
|
class mbedTLSIOHookProvider : public SSLIOHookProvider
|
||||||
{
|
{
|
||||||
mbedTLS::Profile profile;
|
mbedTLS::Profile profile;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
mbedTLSIOHookProvider(Module* mod, mbedTLS::Profile::Config& config)
|
mbedTLSIOHookProvider(Module* mod, mbedTLS::Profile::Config& config)
|
||||||
: IOHookProvider(mod, "ssl/" + config.name, IOHookProvider::IOH_SSL)
|
: SSLIOHookProvider(mod, config.name)
|
||||||
, profile(config)
|
, profile(config)
|
||||||
{
|
{
|
||||||
ServerInstance->Modules->AddService(*this);
|
ServerInstance->Modules->AddService(*this);
|
||||||
|
@ -936,13 +936,13 @@ static int OpenSSL::BIOMethod::read(BIO* bio, char* buffer, int size)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
class OpenSSLIOHookProvider : public IOHookProvider
|
class OpenSSLIOHookProvider : public SSLIOHookProvider
|
||||||
{
|
{
|
||||||
OpenSSL::Profile profile;
|
OpenSSL::Profile profile;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
OpenSSLIOHookProvider(Module* mod, const std::string& profilename, ConfigTag* tag)
|
OpenSSLIOHookProvider(Module* mod, const std::string& profilename, ConfigTag* tag)
|
||||||
: IOHookProvider(mod, "ssl/" + profilename, IOHookProvider::IOH_SSL)
|
: SSLIOHookProvider(mod, profilename)
|
||||||
, profile(profilename, tag)
|
, profile(profilename, tag)
|
||||||
{
|
{
|
||||||
ServerInstance->Modules->AddService(*this);
|
ServerInstance->Modules->AddService(*this);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user