mirror of
https://github.com/inspircd/inspircd.git
synced 2025-03-10 02:59:01 -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
|
||||
{
|
||||
protected:
|
||||
|
@ -1243,13 +1243,13 @@ int GnuTLS::X509Credentials::cert_callback(gnutls_session_t sess, const gnutls_d
|
||||
return 0;
|
||||
}
|
||||
|
||||
class GnuTLSIOHookProvider : public IOHookProvider
|
||||
class GnuTLSIOHookProvider : public SSLIOHookProvider
|
||||
{
|
||||
GnuTLS::Profile profile;
|
||||
|
||||
public:
|
||||
GnuTLSIOHookProvider(Module* mod, GnuTLS::Profile::Config& config)
|
||||
: IOHookProvider(mod, "ssl/" + config.name, IOHookProvider::IOH_SSL)
|
||||
: SSLIOHookProvider(mod, config.name)
|
||||
, profile(config)
|
||||
{
|
||||
ServerInstance->Modules->AddService(*this);
|
||||
|
@ -817,13 +817,13 @@ class mbedTLSIOHook : public SSLIOHook
|
||||
bool IsHandshakeDone() const { return (status == ISSL_HANDSHAKEN); }
|
||||
};
|
||||
|
||||
class mbedTLSIOHookProvider : public IOHookProvider
|
||||
class mbedTLSIOHookProvider : public SSLIOHookProvider
|
||||
{
|
||||
mbedTLS::Profile profile;
|
||||
|
||||
public:
|
||||
mbedTLSIOHookProvider(Module* mod, mbedTLS::Profile::Config& config)
|
||||
: IOHookProvider(mod, "ssl/" + config.name, IOHookProvider::IOH_SSL)
|
||||
: SSLIOHookProvider(mod, config.name)
|
||||
, profile(config)
|
||||
{
|
||||
ServerInstance->Modules->AddService(*this);
|
||||
|
@ -936,13 +936,13 @@ static int OpenSSL::BIOMethod::read(BIO* bio, char* buffer, int size)
|
||||
return ret;
|
||||
}
|
||||
|
||||
class OpenSSLIOHookProvider : public IOHookProvider
|
||||
class OpenSSLIOHookProvider : public SSLIOHookProvider
|
||||
{
|
||||
OpenSSL::Profile profile;
|
||||
|
||||
public:
|
||||
OpenSSLIOHookProvider(Module* mod, const std::string& profilename, ConfigTag* tag)
|
||||
: IOHookProvider(mod, "ssl/" + profilename, IOHookProvider::IOH_SSL)
|
||||
: SSLIOHookProvider(mod, profilename)
|
||||
, profile(profilename, tag)
|
||||
{
|
||||
ServerInstance->Modules->AddService(*this);
|
||||
|
Loading…
x
Reference in New Issue
Block a user