summaryrefslogtreecommitdiff
path: root/src/operator-starttls.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/operator-starttls.cc')
-rw-r--r--src/operator-starttls.cc21
1 files changed, 7 insertions, 14 deletions
diff --git a/src/operator-starttls.cc b/src/operator-starttls.cc
index 3ba5dd0..c127e1a 100644
--- a/src/operator-starttls.cc
+++ b/src/operator-starttls.cc
@@ -1,9 +1,10 @@
-/** --------------------------------------------------------------------
+/**
* @file operator-starttls.cc
* @brief Implementation of the STARTTLS command - based on sslserver
* @author Andreas Aardal Hanssen, Erwin Hoffmann
* @date 2002-2005, 2023
- * ----------------------------------------------------------------- **/
+ */
+
#include "depot.h"
#include "iodevice.h"
#include "iofactory.h"
@@ -17,34 +18,28 @@
#include <fcntl.h>
#include <unistd.h>
-using namespace ::std;
using namespace Binc;
-//----------------------------------------------------------------------
StarttlsOperator::StarttlsOperator(void) {}
-//----------------------------------------------------------------------
StarttlsOperator::~StarttlsOperator(void) {}
-//----------------------------------------------------------------------
-const string StarttlsOperator::getName(void) const
+const std::string StarttlsOperator::getName(void) const
{
return "STARTTLS";
}
-//----------------------------------------------------------------------
int StarttlsOperator::getState(void) const
{
return Session::NONAUTHENTICATED | Session::AUTHENTICATED | Session::SELECTED;
}
-//----------------------------------------------------------------------
int StarttlsOperator::goStartTLS(void) const
{
Session &session = Session::getInstance();
if (getenv("UCSPITLS")) {
- string fdstr;
+ std::string fdstr;
int fd;
fdstr = session.getEnv("SSLCTLFD");
@@ -70,7 +65,6 @@ int StarttlsOperator::goStartTLS(void) const
return ACCEPT;
}
-//------------------------------------------------------------------------
Operator::ProcessResult StarttlsOperator::process(Depot &depot, Request &command)
{
Session &session = Session::getInstance();
@@ -79,8 +73,8 @@ Operator::ProcessResult StarttlsOperator::process(Depot &depot, Request &command
return BAD;
}
- bincClient << "* ENABLED StartTLS - begin negotiation now" << endl;
- bincClient << command.getTag() << " OK STARTTLS completed" << endl;
+ bincClient << "* ENABLED StartTLS - begin negotiation now" << std::endl;
+ bincClient << command.getTag() << " OK STARTTLS completed" << std::endl;
if (goStartTLS() == ACCEPT)
session.command.ssl = true;
@@ -90,7 +84,6 @@ Operator::ProcessResult StarttlsOperator::process(Depot &depot, Request &command
return NOTHING;
}
-//----------------------------------------------------------------------
Operator::ParseResult StarttlsOperator::parse(Request &c_in) const
{
Session &session = Session::getInstance();