diff options
author | Remko Tronçon <git@el-tramo.be> | 2010-12-11 12:43:08 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2010-12-11 12:43:35 (GMT) |
commit | aaf38fe2e6804bd87ea5e99a05ed57070cbe1c57 (patch) | |
tree | 358ff7b5022e0c192e22f746e285f673bf5def9b /Swiften/TLS/OpenSSL | |
parent | d9ce3491e818d96f3dc0154e9e5d30228420483c (diff) | |
download | swift-aaf38fe2e6804bd87ea5e99a05ed57070cbe1c57.zip swift-aaf38fe2e6804bd87ea5e99a05ed57070cbe1c57.tar.bz2 |
Added SCRAM-SHA-1-PLUS support.
Release-Notes: Swift now supports SCRAM-SHA-1-PLUS authentication.
Diffstat (limited to 'Swiften/TLS/OpenSSL')
-rw-r--r-- | Swiften/TLS/OpenSSL/OpenSSLContext.cpp | 9 | ||||
-rw-r--r-- | Swiften/TLS/OpenSSL/OpenSSLContext.h | 2 |
2 files changed, 11 insertions, 0 deletions
diff --git a/Swiften/TLS/OpenSSL/OpenSSLContext.cpp b/Swiften/TLS/OpenSSL/OpenSSLContext.cpp index 50436c7..6c55a63 100644 --- a/Swiften/TLS/OpenSSL/OpenSSLContext.cpp +++ b/Swiften/TLS/OpenSSL/OpenSSLContext.cpp @@ -23,6 +23,7 @@ namespace Swift { +static const int MAX_FINISHED_SIZE = 4096; static const int SSL_READ_BUFFERSIZE = 8192; void freeX509Stack(STACK_OF(X509)* stack) { @@ -210,6 +211,14 @@ boost::shared_ptr<CertificateVerificationError> OpenSSLContext::getPeerCertifica } } +ByteArray OpenSSLContext::getFinishMessage() const { + ByteArray data; + data.resize(MAX_FINISHED_SIZE); + size_t size = SSL_get_finished(handle_, data.getData(), data.getSize()); + data.resize(size); + return data; +} + CertificateVerificationError::Type OpenSSLContext::getVerificationErrorTypeForResult(int result) { assert(result != 0); switch (result) { diff --git a/Swiften/TLS/OpenSSL/OpenSSLContext.h b/Swiften/TLS/OpenSSL/OpenSSLContext.h index 9cb287d..40e5483 100644 --- a/Swiften/TLS/OpenSSL/OpenSSLContext.h +++ b/Swiften/TLS/OpenSSL/OpenSSLContext.h @@ -30,6 +30,8 @@ namespace Swift { Certificate::ref getPeerCertificate() const; boost::shared_ptr<CertificateVerificationError> getPeerCertificateVerificationError() const; + virtual ByteArray getFinishMessage() const; + private: static void ensureLibraryInitialized(); |