summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexey Melnikov <alexey.melnikov@isode.com>2012-03-07 19:16:54 (GMT)
committerKevin Smith <git@kismith.co.uk>2012-03-08 15:18:38 (GMT)
commit0833f7da453db9cd0fc3a78c793e7532663ab86b (patch)
tree0f0dab24760aa0ad5a77a3f5a4b3a25af3420a2a /Swiften/TLS/CAPICertificate.cpp
parent2ba2c34e59c4ec5da9254b6c6f4669e0ee3c3225 (diff)
downloadswift-contrib-0833f7da453db9cd0fc3a78c793e7532663ab86b.zip
swift-contrib-0833f7da453db9cd0fc3a78c793e7532663ab86b.tar.bz2
Fixed several bugs in CAPI/Schannel code on Windows
This patch includes the following fixes: 1) Correctly hex encode SHA1 hashes when generating certstore: URIs 2) Use the newly parsed certificate store reference, not the old value 3) Need to call findCertificateInStore() when finding the selected TLS certificate in Schannel code. Without that "sha1:XXXX" URIs don't work Also minor optimization of string operations. License: This patch is BSD-licensed, see Documentation/Licenses/BSD-simplified.txt for details.
Diffstat (limited to 'Swiften/TLS/CAPICertificate.cpp')
-rw-r--r--Swiften/TLS/CAPICertificate.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/Swiften/TLS/CAPICertificate.cpp b/Swiften/TLS/CAPICertificate.cpp
index a6725c9..0dc3009 100644
--- a/Swiften/TLS/CAPICertificate.cpp
+++ b/Swiften/TLS/CAPICertificate.cpp
@@ -38,7 +38,7 @@ const std::string& CAPICertificate::getCertName() const {
return certName_;
}
-static PCCERT_CONTEXT findCertificateInStore (HCERTSTORE certStoreHandle, const std::string &certName) {
+PCCERT_CONTEXT findCertificateInStore (HCERTSTORE certStoreHandle, const std::string &certName) {
PCCERT_CONTEXT pCertContext = NULL;
if (!boost::iequals(certName.substr(0, 5), "sha1:")) {
@@ -113,7 +113,7 @@ void CAPICertificate::setUri (const std::string& capiUri) {
}
if (certStoreHandle_ == NULL) {
- certStoreHandle_ = CertOpenSystemStore(0, certStore_.c_str());
+ certStoreHandle_ = CertOpenSystemStore(0, new_certStore_name.c_str());
if (!certStoreHandle_) {
return;
}