From eca0f020873f7620c5125101113e2c1eb25b273e Mon Sep 17 00:00:00 2001
From: Kevin Smith <git@kismith.co.uk>
Date: Thu, 23 Feb 2012 15:06:11 +0000
Subject: Compile when non-SChannel


diff --git a/Swiften/SConscript b/Swiften/SConscript
index 9e61fc6..258b566 100644
--- a/Swiften/SConscript
+++ b/Swiften/SConscript
@@ -413,7 +413,7 @@ if env["SCONS_STAGE"] == "build" :
 				continue
 
 			# Library-specific files
-			if file.startswith("Schannel") or file.startswith("CAres") or file.startswith("LibXML") or file.startswith("Expat") or file.startswith("GConf") or file.startswith("MacOSX") or file.startswith("Windows") or file.startswith("SQLite") or file.startswith("NATPMP") or file.startswith("MiniUPnP") :
+			if file.startswith("Schannel") or file.startswith("CAPI") or file.startswith("CAres") or file.startswith("LibXML") or file.startswith("Expat") or file.startswith("GConf") or file.startswith("MacOSX") or file.startswith("Windows") or file.startswith("SQLite") or file.startswith("NATPMP") or file.startswith("MiniUPnP") :
 				continue
 
 			# Specific headers we don't want to globally include
diff --git a/Swiften/TLS/OpenSSL/OpenSSLContext.cpp b/Swiften/TLS/OpenSSL/OpenSSLContext.cpp
index 8076967..54addef 100644
--- a/Swiften/TLS/OpenSSL/OpenSSLContext.cpp
+++ b/Swiften/TLS/OpenSSL/OpenSSLContext.cpp
@@ -22,6 +22,7 @@
 #include <Swiften/TLS/OpenSSL/OpenSSLContext.h>
 #include <Swiften/TLS/OpenSSL/OpenSSLCertificate.h>
 #include <Swiften/TLS/CertificateWithKey.h>
+#include <Swiften/TLS/PKCS12Certificate.h>
 
 #pragma GCC diagnostic ignored "-Wold-style-cast"
 
@@ -185,7 +186,7 @@ void OpenSSLContext::sendPendingDataToApplication() {
 	}
 }
 
-bool OpenSSLContext::setClientCertificate(CertificateWithKey * certificate) {
+bool OpenSSLContext::setClientCertificate(CertificateWithKey::ref certificate) {
 	boost::shared_ptr<PKCS12Certificate> pkcs12Certificate = boost::dynamic_pointer_cast<PKCS12Certificate>(certificate);
 	if (!pkcs12Certificate || pkcs12Certificate->isNull()) {
 		return false;
@@ -193,7 +194,7 @@ bool OpenSSLContext::setClientCertificate(CertificateWithKey * certificate) {
 
 	// Create a PKCS12 structure
 	BIO* bio = BIO_new(BIO_s_mem());
-	BIO_write(bio, vecptr(certificate->getData()), pkcs12Certificate->getData().size());
+	BIO_write(bio, vecptr(pkcs12Certificate->getData()), pkcs12Certificate->getData().size());
 	boost::shared_ptr<PKCS12> pkcs12(d2i_PKCS12_bio(bio, NULL), PKCS12_free);
 	BIO_free(bio);
 	if (!pkcs12) {
diff --git a/Swiften/TLS/OpenSSL/OpenSSLContext.h b/Swiften/TLS/OpenSSL/OpenSSLContext.h
index e98fb49..d8d0d2f 100644
--- a/Swiften/TLS/OpenSSL/OpenSSLContext.h
+++ b/Swiften/TLS/OpenSSL/OpenSSLContext.h
@@ -12,9 +12,9 @@
 
 #include <Swiften/TLS/TLSContext.h>
 #include <Swiften/Base/ByteArray.h>
+#include <Swiften/TLS/CertificateWithKey.h>
 
 namespace Swift {
-	class CertificateWithKey;
 
 	class OpenSSLContext : public TLSContext, boost::noncopyable {
 		public:
-- 
cgit v0.10.2-6-g49f6