From 9c1cbf5dc8a76fdfd5d4c0800178069064f1e6fa Mon Sep 17 00:00:00 2001 From: Dylan Lloyd Date: Fri, 27 Nov 2015 15:08:27 -0800 Subject: [PATCH] rename *Raw parameters/methods to Use* sed -i \ -e 's/m_pCertRaw/m_pUseCert/g' \ -e 's/m_pKeyRaw/m_pUseKey/g' \ -e 's/m_pDHParamRaw/m_pUseDHParam/g' \ Csocket.{cc,h} --- Csocket.cc | 42 +++++++++++++++++++++--------------------- Csocket.h | 36 ++++++++++++++++++------------------ 2 files changed, 39 insertions(+), 39 deletions(-) diff --git a/Csocket.cc b/Csocket.cc index 5850999..b3b79e2 100644 --- a/Csocket.cc +++ b/Csocket.cc @@ -1044,9 +1044,9 @@ void Csock::Copy( const Csock & cCopy ) m_shostname = cCopy.m_shostname; m_sbuffer = cCopy.m_sbuffer; m_sSockName = cCopy.m_sSockName; - m_pKeyRaw = cCopy.m_pKeyRaw; - m_pCertRaw = cCopy.m_pCertRaw; - m_pDHParamRaw = cCopy.m_pDHParamRaw; + m_pUseKey = cCopy.m_pUseKey; + m_pUseCert = cCopy.m_pUseCert; + m_pUseDHParam = cCopy.m_pUseDHParam; m_sKeyFile = cCopy.m_sKeyFile; m_sDHParamFile = cCopy.m_sDHParamFile; m_sPemFile = cCopy.m_sPemFile; @@ -1578,14 +1578,14 @@ bool Csock::SSLClientSetup() SSL_CTX_set_default_passwd_cb_userdata( m_ssl_ctx, ( void * )this ); // set up the CTX - if( m_pCertRaw && m_pKeyRaw ) + if( m_pUseCert && m_pUseKey ) { - if( SSL_CTX_use_certificate( m_ssl_ctx, m_pCertRaw ) <= 0 ) + if( SSL_CTX_use_certificate( m_ssl_ctx, m_pUseCert ) <= 0 ) { CS_DEBUG( "Error with SSLCert file [" << m_sPemFile << "]" ); SSLErrors( __FILE__, __LINE__ ); } - if( SSL_CTX_use_PrivateKey( m_ssl_ctx, m_pKeyRaw ) <= 0 ) + if( SSL_CTX_use_PrivateKey( m_ssl_ctx, m_pUseKey ) <= 0 ) { CS_DEBUG( "Error with SSLCert file [" << m_sPemFile << "]" ); SSLErrors( __FILE__, __LINE__ ); @@ -1719,7 +1719,7 @@ SSL_CTX * Csock::SetupServerCTX() SSL_CTX_set_default_passwd_cb( pCTX, _PemPassCB ); SSL_CTX_set_default_passwd_cb_userdata( pCTX, ( void * )this ); - if( !m_pCertRaw ) + if( !m_pUseCert ) { if( m_sPemFile.empty() || access( m_sPemFile.c_str(), R_OK ) != 0 ) { @@ -1742,7 +1742,7 @@ SSL_CTX * Csock::SetupServerCTX() } else { - if( SSL_CTX_use_certificate( pCTX, m_pCertRaw ) <= 0 ) + if( SSL_CTX_use_certificate( pCTX, m_pUseCert ) <= 0 ) { CS_DEBUG( "Error with SSLCert file [" << m_sPemFile << "]" ); SSLErrors( __FILE__, __LINE__ ); @@ -1750,7 +1750,7 @@ SSL_CTX * Csock::SetupServerCTX() } - if( !m_pKeyRaw ) + if( !m_pUseKey ) { if( ! m_sKeyFile.empty() && access( m_sKeyFile.c_str(), R_OK ) != 0 ) { @@ -1772,7 +1772,7 @@ SSL_CTX * Csock::SetupServerCTX() } else { - if( SSL_CTX_use_PrivateKey( pCTX, m_pKeyRaw ) <= 0 ) + if( SSL_CTX_use_PrivateKey( pCTX, m_pUseKey ) <= 0 ) { CS_DEBUG( "Error with SSLCert file [" << m_sPemFile << "]" ); SSLErrors( __FILE__, __LINE__ ); @@ -1782,7 +1782,7 @@ SSL_CTX * Csock::SetupServerCTX() // check to see if this pem file contains a DH structure for use with DH key exchange // https://github.com/znc/znc/pull/46 DH * pDHParam; - if( !m_pDHParamRaw ) + if( !m_pUseDHParam ) { CS_STRING sDHParamFile = m_sDHParamFile.empty() ? m_sPemFile : m_sDHParamFile; FILE *pDHParamsFile = fopen( sDHParamFile.c_str(), "r" ); @@ -1797,7 +1797,7 @@ SSL_CTX * Csock::SetupServerCTX() } else { - pDHParam = m_pDHParamRaw; + pDHParam = m_pUseDHParam; } if( pDHParam ) { @@ -2598,14 +2598,14 @@ void Csock::SetSSL( bool b ) { m_bUseSSL = b; } void Csock::SetCipher( const CS_STRING & sCipher ) { m_sCipherType = sCipher; } const CS_STRING & Csock::GetCipher() const { return( m_sCipherType ); } -void Csock::SetKeyRaw( EVP_PKEY * sKeyRaw ) { m_pKeyRaw = sKeyRaw; } -EVP_PKEY * Csock::GetKeyRaw() const { return( m_pKeyRaw ); } +void Csock::SetKeyRaw( EVP_PKEY * sKeyRaw ) { m_pUseKey = sKeyRaw; } +EVP_PKEY * Csock::GetKeyRaw() const { return( m_pUseKey ); } -void Csock::SetCertRaw( X509 * sCertRaw ) { m_pCertRaw = sCertRaw; } -X509 * Csock::GetCertRaw() const { return( m_pCertRaw ); } +void Csock::SetCertRaw( X509 * sCertRaw ) { m_pUseCert = sCertRaw; } +X509 * Csock::GetCertRaw() const { return( m_pUseCert ); } -void Csock::SetDHParamRaw( DH * sDHParamRaw ) { m_pDHParamRaw = sDHParamRaw; } -DH * Csock::GetDHParamRaw() const { return( m_pDHParamRaw ); } +void Csock::SetDHParamRaw( DH * sDHParamRaw ) { m_pUseDHParam = sDHParamRaw; } +DH * Csock::GetDHParamRaw() const { return( m_pUseDHParam ); } void Csock::SetDHParamLocation( const CS_STRING & sDHParamFile ) { m_sDHParamFile = sDHParamFile; } const CS_STRING & Csock::GetDHParamLocation() const { return( m_sDHParamFile ); } @@ -3127,9 +3127,9 @@ void Csock::Init( const CS_STRING & sHostname, uint16_t uPort, int iTimeout ) m_uDisableProtocols = 0; m_bNoSSLCompression = false; m_bSSLCipherServerPreference = false; - m_pCertRaw = NULL; - m_pKeyRaw = NULL; - m_pDHParamRaw = NULL; + m_pUseCert = NULL; + m_pUseKey = NULL; + m_pUseDHParam = NULL; #endif /* HAVE_LIBSSL */ m_iTcount = 0; m_iReadSock = CS_INVALID_SOCK; diff --git a/Csocket.h b/Csocket.h index 87ad296..7f1eb87 100644 --- a/Csocket.h +++ b/Csocket.h @@ -1180,9 +1180,9 @@ class CS_EXPORT Csock : public CSockCommon bool m_bUseSSL, m_bIsConnected; bool m_bsslEstablished, m_bEnableReadLine, m_bPauseRead; CS_STRING m_shostname, m_sbuffer, m_sSockName, m_sDHParamFile, m_sKeyFile, m_sPemFile, m_sCipherType, m_sParentName; - X509* m_pCertRaw; - EVP_PKEY* m_pKeyRaw; - DH* m_pDHParamRaw; + X509* m_pUseCert; + EVP_PKEY* m_pUseKey; + DH* m_pUseDHParam; CS_STRING m_sSend, m_sPemPass; ECloseType m_eCloseType; @@ -1275,9 +1275,9 @@ class CS_EXPORT CSConnection #ifdef HAVE_LIBSSL const CS_STRING & GetCipher() const { return( m_sCipher ); } - const X509 * GetCertRaw() const { return( m_pCertRaw ); } - const EVP_PKEY * GetKeyRaw() const { return( m_pKeyRaw ); } - const DH * GetDHParamRaw() const { return( m_pDHParamRaw ); } + const X509 * GetCertRaw() const { return( m_pUseCert ); } + const EVP_PKEY * GetKeyRaw() const { return( m_pUseKey ); } + const DH * GetDHParamRaw() const { return( m_pUseDHParam ); } const CS_STRING & GetPemLocation() const { return( m_sPemLocation ); } const CS_STRING & GetKeyLocation() const { return( m_sKeyLocation ); } const CS_STRING & GetDHParamLocation() const { return( m_sDHParamLocation ); } @@ -1316,9 +1316,9 @@ class CS_EXPORT CSConnection CSSockAddr::EAFRequire m_iAFrequire; #ifdef HAVE_LIBSSL CS_STRING m_sDHParamLocation, m_sKeyLocation, m_sPemLocation, m_sPemPass, m_sCipher; - X509* m_pCertRaw; - EVP_PKEY* m_pKeyRaw; - DH* m_pDHParamRaw; + X509* m_pUseCert; + EVP_PKEY* m_pUseKey; + DH* m_pUseDHParam; #endif /* HAVE_LIBSSL */ }; @@ -1373,9 +1373,9 @@ class CS_EXPORT CSListener #ifdef HAVE_LIBSSL const CS_STRING & GetCipher() const { return( m_sCipher ); } const CS_STRING & GetDHParamLocation() const { return( m_sDHParamLocation ); } - const EVP_PKEY * GetKeyRaw() const { return( m_pKeyRaw ); } - const X509 * GetCertRaw() const { return( m_pCertRaw ); } - const DH * GetDHParamRaw() const { return( m_pDHParamRaw ); } + const EVP_PKEY * GetKeyRaw() const { return( m_pUseKey ); } + const X509 * GetCertRaw() const { return( m_pUseCert ); } + const DH * GetDHParamRaw() const { return( m_pUseDHParam ); } const CS_STRING & GetKeyLocation() const { return( m_sKeyLocation ); } const CS_STRING & GetPemLocation() const { return( m_sPemLocation ); } const CS_STRING & GetPemPass() const { return( m_sPemPass ); } @@ -1401,11 +1401,11 @@ class CS_EXPORT CSListener //! set the cipher strength to use, default is HIGH void SetCipher( const CS_STRING & s ) { m_sCipher = s; } //! set the raw cert data - void SetCertRaw( X509 * s ) { m_pCertRaw = s; } + void SetCertRaw( X509 * s ) { m_pUseCert = s; } //! set the raw key data - void SetKeyRaw( EVP_PKEY * s ) { m_pKeyRaw = s; } + void SetKeyRaw( EVP_PKEY * s ) { m_pUseKey = s; } //! set the raw dhparam data - void SetDHParamRaw( DH * s ) { m_pDHParamRaw = s; } + void SetDHParamRaw( DH * s ) { m_pUseDHParam = s; } //! set the location of the pemfile void SetPemLocation( const CS_STRING & s ) { m_sPemLocation = s; } //! set the location of the keyfile @@ -1430,9 +1430,9 @@ class CS_EXPORT CSListener #ifdef HAVE_LIBSSL CS_STRING m_sDHParamLocation, m_sKeyLocation, m_sPemLocation, m_sPemPass, m_sCipher; - X509* m_pCertRaw; - EVP_PKEY* m_pKeyRaw; - DH* m_pDHParamRaw; + X509* m_pUseCert; + EVP_PKEY* m_pUseKey; + DH* m_pUseDHParam; uint32_t m_iRequireCertFlags; #endif /* HAVE_LIBSSL */ };