class CommandStartTLS : public SplitCommand
{
- dynamic_reference_nocheck<IOHook>& ssl;
+ dynamic_reference_nocheck<IOHookProvider>& ssl;
public:
- CommandStartTLS(Module* mod, dynamic_reference_nocheck<IOHook>& s)
+ CommandStartTLS(Module* mod, dynamic_reference_nocheck<IOHookProvider>& s)
: SplitCommand(mod, "STARTTLS")
, ssl(s)
{
{
if (!ssl)
{
- user->WriteNumeric(ERR_STARTTLS, ":STARTTLS is not enabled");
+ user->WriteNumeric(ERR_STARTTLS, "STARTTLS is not enabled");
return CMD_FAILURE;
}
if (user->registered == REG_ALL)
{
- user->WriteNumeric(ERR_STARTTLS, ":STARTTLS is not permitted after client registration is complete");
+ user->WriteNumeric(ERR_STARTTLS, "STARTTLS is not permitted after client registration is complete");
return CMD_FAILURE;
}
if (user->eh.GetIOHook())
{
- user->WriteNumeric(ERR_STARTTLS, ":STARTTLS failure");
+ user->WriteNumeric(ERR_STARTTLS, "STARTTLS failure");
return CMD_FAILURE;
}
- user->WriteNumeric(RPL_STARTTLS, ":STARTTLS successful, go ahead with TLS handshake");
+ user->WriteNumeric(RPL_STARTTLS, "STARTTLS successful, go ahead with TLS handshake");
/* We need to flush the write buffer prior to adding the IOHook,
* otherwise we'll be sending this line inside the SSL session - which
* won't start its handshake until the client gets this line. Currently,
*/
user->eh.DoWrite();
- user->eh.AddIOHook(*ssl);
- ssl->OnStreamSocketAccept(&user->eh, NULL, NULL);
+ ssl->OnAccept(&user->eh, NULL, NULL);
return CMD_SUCCESS;
}
class ModuleStartTLS : public Module
{
CommandStartTLS starttls;
- GenericCap tls;
- dynamic_reference_nocheck<IOHook> ssl;
+ Cap::Capability tls;
+ dynamic_reference_nocheck<IOHookProvider> ssl;
public:
ModuleStartTLS()
ssl.SetProvider("ssl/" + newprovider);
}
- void OnEvent(Event& ev) CXX11_OVERRIDE
- {
- tls.HandleEvent(ev);
- }
-
- void On005Numeric(std::map<std::string, std::string>& tokens) CXX11_OVERRIDE
- {
- tokens["STARTTLS"];
- }
-
Version GetVersion() CXX11_OVERRIDE
{
return Version("Provides support for the STARTTLS command", VF_VENDOR);