summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2012-04-25 17:32:37 (GMT)
committerRemko Tronçon <git@el-tramo.be>2012-04-25 17:32:37 (GMT)
commit76b6528058e1cb9fefb0547b672acb83e7b41ff4 (patch)
treea491b00a68475abd0ec92e398326228c187d6f2b
parentb997b3cdc0ebd32e8be97e5c6265c6c15de7706a (diff)
downloadswift-76b6528058e1cb9fefb0547b672acb83e7b41ff4.zip
swift-76b6528058e1cb9fefb0547b672acb83e7b41ff4.tar.bz2
Support channel binding with Schannel.
Resolves: #1012
-rw-r--r--Swiften/TLS/Schannel/SchannelContext.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/Swiften/TLS/Schannel/SchannelContext.cpp b/Swiften/TLS/Schannel/SchannelContext.cpp
index 20cb7d3..641568d 100644
--- a/Swiften/TLS/Schannel/SchannelContext.cpp
+++ b/Swiften/TLS/Schannel/SchannelContext.cpp
@@ -640,10 +640,12 @@ CertificateVerificationError::ref SchannelContext::getPeerCertificateVerificatio
//------------------------------------------------------------------------
ByteArray SchannelContext::getFinishMessage() const {
- // TODO: Implement
-
- ByteArray emptyArray;
- return emptyArray;
+ SecPkgContext_Bindings bindings;
+ int ret = QueryContextAttributes(m_ctxtHandle, SECPKG_ATTR_UNIQUE_BINDINGS, &bindings);
+ if (ret == SEC_E_OK) {
+ return createByteArray(((unsigned char*) bindings.Bindings) + bindings.Bindings->dwApplicationDataOffset + 11 /* tls-unique:*/, bindings.Bindings->cbApplicationDataLength - 11);
+ }
+ return ByteArray();
}
//------------------------------------------------------------------------