summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexey Melnikov <alexey.melnikov@isode.com>2012-02-13 17:54:23 (GMT)
committerKevin Smith <git@kismith.co.uk>2012-02-22 14:08:13 (GMT)
commit110eb87e848b85dd74a6f19413c775520a75ea35 (patch)
treeb10236387180fca676a29f24c747c9d0fd94d8dd /Swiften/Session
parent64fc103d0d5d1d523d00dcc5b231715160475f7e (diff)
downloadswift-110eb87e848b85dd74a6f19413c775520a75ea35.zip
swift-110eb87e848b85dd74a6f19413c775520a75ea35.tar.bz2
Initial implementation of using CAPI certificates with Schannel.
Introduced a new parent class for all certificates with keys (class CertificateWithKey is the new parent for PKCS12Certificate.) Switched to using "CertificateWithKey *" instead of "const CertificateWithKey&" Added calling of a Windows dialog for certificate selection when Schannel TLS implementation is used. This compiles, but is not tested. License: This patch is BSD-licensed, see Documentation/Licenses/BSD-simplified.txt for details.
Diffstat (limited to 'Swiften/Session')
-rw-r--r--Swiften/Session/SessionStream.cpp1
-rw-r--r--Swiften/Session/SessionStream.h12
2 files changed, 8 insertions, 5 deletions
diff --git a/Swiften/Session/SessionStream.cpp b/Swiften/Session/SessionStream.cpp
index 0d73b63..487ad8b 100644
--- a/Swiften/Session/SessionStream.cpp
+++ b/Swiften/Session/SessionStream.cpp
@@ -9,6 +9,7 @@
namespace Swift {
SessionStream::~SessionStream() {
+ delete certificate;
}
};
diff --git a/Swiften/Session/SessionStream.h b/Swiften/Session/SessionStream.h
index 096f185..58015b3 100644
--- a/Swiften/Session/SessionStream.h
+++ b/Swiften/Session/SessionStream.h
@@ -14,7 +14,7 @@
#include <Swiften/Elements/Element.h>
#include <Swiften/Base/Error.h>
#include <Swiften/Base/SafeByteArray.h>
-#include <Swiften/TLS/PKCS12Certificate.h>
+#include <Swiften/TLS/CertificateWithKey.h>
#include <Swiften/TLS/Certificate.h>
#include <Swiften/TLS/CertificateVerificationError.h>
@@ -36,6 +36,8 @@ namespace Swift {
Type type;
};
+ SessionStream(): certificate(0) {}
+
virtual ~SessionStream();
virtual void close() = 0;
@@ -56,12 +58,12 @@ namespace Swift {
virtual void resetXMPPParser() = 0;
- void setTLSCertificate(const PKCS12Certificate& cert) {
+ void setTLSCertificate(CertificateWithKey* cert) {
certificate = cert;
}
virtual bool hasTLSCertificate() {
- return !certificate.isNull();
+ return certificate && !certificate->isNull();
}
virtual Certificate::ref getPeerCertificate() const = 0;
@@ -77,11 +79,11 @@ namespace Swift {
boost::signal<void (const SafeByteArray&)> onDataWritten;
protected:
- const PKCS12Certificate& getTLSCertificate() const {
+ CertificateWithKey * getTLSCertificate() const {
return certificate;
}
private:
- PKCS12Certificate certificate;
+ CertificateWithKey * certificate;
};
}