diff options
Diffstat (limited to '')
-rw-r--r-- | src/security/cert/X509Certificate.cpp | 9 | ||||
-rw-r--r-- | src/security/cert/certificateChain.cpp | 2 | ||||
-rw-r--r-- | src/security/digest/md5/md5MessageDigest.cpp | 4 | ||||
-rw-r--r-- | src/security/digest/sha1/sha1MessageDigest.cpp | 14 | ||||
-rw-r--r-- | src/security/sasl/SASLMechanismFactory.cpp | 4 | ||||
-rw-r--r-- | src/security/sasl/SASLSession.cpp | 2 | ||||
-rw-r--r-- | src/security/sasl/SASLSocket.cpp | 4 | ||||
-rw-r--r-- | src/security/sasl/builtinSASLMechanism.cpp | 14 |
8 files changed, 28 insertions, 25 deletions
diff --git a/src/security/cert/X509Certificate.cpp b/src/security/cert/X509Certificate.cpp index be8f0f4e..ac1f7e04 100644 --- a/src/security/cert/X509Certificate.cpp +++ b/src/security/cert/X509Certificate.cpp @@ -147,15 +147,14 @@ const byteArray X509Certificate::getSerialNumber() const } -const bool X509Certificate::checkIssuer - (ref <const X509Certificate> issuer) const +bool X509Certificate::checkIssuer(ref <const X509Certificate> issuer) const { return (gnutls_x509_crt_check_issuer (m_data->cert, issuer->m_data->cert) >= 1); } -const bool X509Certificate::verify(ref <const X509Certificate> caCert) const +bool X509Certificate::verify(ref <const X509Certificate> caCert) const { unsigned int verify = 0; @@ -236,13 +235,13 @@ const string X509Certificate::getType() const } -const int X509Certificate::getVersion() const +int X509Certificate::getVersion() const { return gnutls_x509_crt_get_version(m_data->cert); } -const bool X509Certificate::equals(ref <const certificate> other) const +bool X509Certificate::equals(ref <const certificate> other) const { ref <const X509Certificate> otherX509 = other.dynamicCast <const X509Certificate>(); diff --git a/src/security/cert/certificateChain.cpp b/src/security/cert/certificateChain.cpp index b2e2a065..0425d003 100644 --- a/src/security/cert/certificateChain.cpp +++ b/src/security/cert/certificateChain.cpp @@ -35,7 +35,7 @@ certificateChain::certificateChain(const std::vector <ref <certificate> >& certs } -const unsigned int certificateChain::getCount() const +unsigned int certificateChain::getCount() const { return static_cast <unsigned int>(m_certs.size()); } diff --git a/src/security/digest/md5/md5MessageDigest.cpp b/src/security/digest/md5/md5MessageDigest.cpp index ac3773d5..d83908fe 100644 --- a/src/security/digest/md5/md5MessageDigest.cpp +++ b/src/security/digest/md5/md5MessageDigest.cpp @@ -50,6 +50,8 @@ #include "vmime/security/digest/md5/md5MessageDigest.hpp" +#include <cstring> + namespace vmime { namespace security { @@ -327,7 +329,7 @@ void md5MessageDigest::transform() } -const int md5MessageDigest::getDigestLength() const +int md5MessageDigest::getDigestLength() const { return 16; } diff --git a/src/security/digest/sha1/sha1MessageDigest.cpp b/src/security/digest/sha1/sha1MessageDigest.cpp index b86cb996..a51e250d 100644 --- a/src/security/digest/sha1/sha1MessageDigest.cpp +++ b/src/security/digest/sha1/sha1MessageDigest.cpp @@ -26,6 +26,8 @@ #include "vmime/security/digest/sha1/sha1MessageDigest.hpp" +#include <cstring> + namespace vmime { namespace security { @@ -126,7 +128,7 @@ void sha1MessageDigest::update(const byte_t* buffer, const unsigned long len) i = 0; } - memcpy(&m_buffer[j], &buffer[i], len - i); + std::memcpy(&m_buffer[j], &buffer[i], len - i); } @@ -158,10 +160,10 @@ void sha1MessageDigest::finalize() // Wipe variables i = j = 0; - memset(m_buffer, 0, 64); - memset(m_state, 0, 20); - memset(m_count, 0, 8); - memset(&finalcount, 0, 8); + std::memset(m_buffer, 0, 64); + std::memset(m_state, 0, 20); + std::memset(m_count, 0, 8); + std::memset(&finalcount, 0, 8); } @@ -246,7 +248,7 @@ void sha1MessageDigest::transform } -const int sha1MessageDigest::getDigestLength() const +int sha1MessageDigest::getDigestLength() const { return 20; } diff --git a/src/security/sasl/SASLMechanismFactory.cpp b/src/security/sasl/SASLMechanismFactory.cpp index 37858199..a866e0cf 100644 --- a/src/security/sasl/SASLMechanismFactory.cpp +++ b/src/security/sasl/SASLMechanismFactory.cpp @@ -115,14 +115,14 @@ const std::vector <string> SASLMechanismFactory::getSupportedMechanisms() const } } - free(out); + gsasl_free(out); } return list; } -const bool SASLMechanismFactory::isMechanismSupported(const string& name) const +bool SASLMechanismFactory::isMechanismSupported(const string& name) const { return (gsasl_client_support_p(m_gsaslContext, name.c_str()) != 0 || m_mechs.find(name) != m_mechs.end()); diff --git a/src/security/sasl/SASLSession.cpp b/src/security/sasl/SASLSession.cpp index 01da8ee9..f7f80f59 100644 --- a/src/security/sasl/SASLSession.cpp +++ b/src/security/sasl/SASLSession.cpp @@ -92,7 +92,7 @@ ref <SASLContext> SASLSession::getContext() } -const bool SASLSession::evaluateChallenge +bool SASLSession::evaluateChallenge (const byte_t* challenge, const int challengeLen, byte_t** response, int* responseLen) { diff --git a/src/security/sasl/SASLSocket.cpp b/src/security/sasl/SASLSocket.cpp index 50c31e1b..5f86aed5 100644 --- a/src/security/sasl/SASLSocket.cpp +++ b/src/security/sasl/SASLSocket.cpp @@ -63,7 +63,7 @@ void SASLSocket::disconnect() } -const bool SASLSocket::isConnected() const +bool SASLSocket::isConnected() const { return m_wrapped->isConnected(); } @@ -77,7 +77,7 @@ void SASLSocket::receive(string& buffer) } -const int SASLSocket::receiveRaw(char* buffer, const int count) +int SASLSocket::receiveRaw(char* buffer, const int count) { if (m_pendingLen != 0) { diff --git a/src/security/sasl/builtinSASLMechanism.cpp b/src/security/sasl/builtinSASLMechanism.cpp index 168b34cb..1c958311 100644 --- a/src/security/sasl/builtinSASLMechanism.cpp +++ b/src/security/sasl/builtinSASLMechanism.cpp @@ -56,7 +56,7 @@ const string builtinSASLMechanism::getName() const } -const bool builtinSASLMechanism::step +bool builtinSASLMechanism::step (ref <SASLSession> sess, const byte_t* challenge, const int challengeLen, byte_t** response, int* responseLen) { @@ -77,7 +77,7 @@ const bool builtinSASLMechanism::step *response = res; *responseLen = outputLen; - free(output); + gsasl_free(output); } else { @@ -108,7 +108,7 @@ const bool builtinSASLMechanism::step } -const bool builtinSASLMechanism::isComplete() const +bool builtinSASLMechanism::isComplete() const { return m_complete; } @@ -139,11 +139,11 @@ void builtinSASLMechanism::encode } catch (...) { - free(coutput); + gsasl_free(coutput); throw; } - free(coutput); + gsasl_free(coutput); } @@ -172,11 +172,11 @@ void builtinSASLMechanism::decode } catch (...) { - free(coutput); + gsasl_free(coutput); throw; } - free(coutput); + gsasl_free(coutput); } |