diff options
author | Anthony Neal <aneal@zeroc.com> | 2002-03-13 20:10:07 +0000 |
---|---|---|
committer | Anthony Neal <aneal@zeroc.com> | 2002-03-13 20:10:07 +0000 |
commit | 27c5fa0a95a523c5bea82eecc420e805b4533aae (patch) | |
tree | b18f7be9632d266d7e8f6c16b02de831a3e11d57 /cpp/src/Ice/SslConnectionOpenSSLServer.cpp | |
parent | cleanup (diff) | |
download | ice-27c5fa0a95a523c5bea82eecc420e805b4533aae.tar.bz2 ice-27c5fa0a95a523c5bea82eecc420e805b4533aae.tar.xz ice-27c5fa0a95a523c5bea82eecc420e805b4533aae.zip |
Refactor of SSL Extension, phase 1.
Diffstat (limited to 'cpp/src/Ice/SslConnectionOpenSSLServer.cpp')
-rw-r--r-- | cpp/src/Ice/SslConnectionOpenSSLServer.cpp | 46 |
1 files changed, 24 insertions, 22 deletions
diff --git a/cpp/src/Ice/SslConnectionOpenSSLServer.cpp b/cpp/src/Ice/SslConnectionOpenSSLServer.cpp index 54497011d7b..07f16c809a1 100644 --- a/cpp/src/Ice/SslConnectionOpenSSLServer.cpp +++ b/cpp/src/Ice/SslConnectionOpenSSLServer.cpp @@ -18,9 +18,9 @@ #include <Ice/TraceLevels.h> #include <Ice/Logger.h> -using IceSecurity::Ssl::CertificateException; -using IceSecurity::Ssl::ProtocolException; -using IceSecurity::Ssl::SystemPtr; +using IceSSL::CertificateException; +using IceSSL::ProtocolException; +using IceSSL::SystemInternalPtr; using Ice::ConnectionLostException; using Ice::SocketException; @@ -42,33 +42,35 @@ using std::dec; // // Note: I would use a using directive of the form: -// using IceSecurity::Ssl::CertificateVerifierPtr; +// using IceSSL::CertificateVerifierPtr; // but unfortunately, it appears that this is not properly picked up. // -IceSecurity::Ssl::OpenSSL::ServerConnection::ServerConnection( - const IceSecurity::Ssl::CertificateVerifierPtr& certificateVerifier, - SSL* connection, - const SystemPtr& system) : - Connection(certificateVerifier, - connection, - system) +IceSSL::OpenSSL::ServerConnection::ServerConnection( + const IceInternal::TraceLevelsPtr& traceLevels,
+ const Ice::LoggerPtr& logger,
+ const IceSSL::CertificateVerifierPtr& certificateVerifier, + SSL* connection,
+ const IceSSL::SystemInternalPtr& system) : + Connection(traceLevels, logger, certificateVerifier, connection, system) { + // Set the Accept Connection state for this connection.
+ SSL_set_accept_state(_sslConnection);
} -IceSecurity::Ssl::OpenSSL::ServerConnection::~ServerConnection() +IceSSL::OpenSSL::ServerConnection::~ServerConnection() { } void -IceSecurity::Ssl::OpenSSL::ServerConnection::shutdown() +IceSSL::OpenSSL::ServerConnection::shutdown() { Connection::shutdown(); } int -IceSecurity::Ssl::OpenSSL::ServerConnection::init(int timeout) -{ +IceSSL::OpenSSL::ServerConnection::init(int timeout) +{
int retCode = SSL_is_init_finished(_sslConnection); while (!retCode) @@ -152,7 +154,7 @@ IceSecurity::Ssl::OpenSSL::ServerConnection::init(int timeout) } case SSL_ERROR_SYSCALL: - { + {
// This is a SOCKET_ERROR, but we don't use // this define here as OpenSSL doesn't refer // to it as a SOCKET_ERROR (but that's what it is @@ -207,7 +209,7 @@ IceSecurity::Ssl::OpenSSL::ServerConnection::init(int timeout) } retCode = SSL_is_init_finished(_sslConnection); - +
if (retCode > 0) { // Init finished, look at the connection information. @@ -219,7 +221,7 @@ IceSecurity::Ssl::OpenSSL::ServerConnection::init(int timeout) } int -IceSecurity::Ssl::OpenSSL::ServerConnection::read(Buffer& buf, int timeout) +IceSSL::OpenSSL::ServerConnection::read(Buffer& buf, int timeout) { int bytesRead = 1; int totalBytesRead = 0; @@ -245,7 +247,7 @@ IceSecurity::Ssl::OpenSSL::ServerConnection::read(Buffer& buf, int timeout) } int -IceSecurity::Ssl::OpenSSL::ServerConnection::write(Buffer& buf, int timeout) +IceSSL::OpenSSL::ServerConnection::write(Buffer& buf, int timeout) { int totalBytesWritten = 0; int bytesWritten = 0; @@ -385,10 +387,10 @@ IceSecurity::Ssl::OpenSSL::ServerConnection::write(Buffer& buf, int timeout) // void -IceSecurity::Ssl::OpenSSL::ServerConnection::showConnectionInfo() -{ +IceSSL::OpenSSL::ServerConnection::showConnectionInfo() +{
// Only in extreme cases do we enable this, partially because it doesn't use the Logger. - if ((_traceLevels->security >= IceSecurity::SECURITY_PROTOCOL_DEBUG) && 0) + if ((_traceLevels->security >= IceSSL::SECURITY_PROTOCOL_DEBUG) && 0) { BIO* bio = BIO_new_fp(stdout, BIO_NOCLOSE); |