soc.2009.transport: 09898d87: Move Facebook certificate load to facebo...

hanzz at soc.pidgin.im hanzz at soc.pidgin.im
Mon May 25 20:45:46 EDT 2009


-----------------------------------------------------------------
Revision: 09898d870ead50d1390747ce3711215fdc7f14c2
Ancestor: 05b69c63bdaff5b60f78753244dde5f5c8e16631
Author: hanzz at soc.pidgin.im
Date: 2009-05-26T00:25:12
Branch: im.pidgin.soc.2009.transport
URL: http://d.pidgin.im/viewmtn/revision/info/09898d870ead50d1390747ce3711215fdc7f14c2

Modified files:
        main.cpp protocols/facebook.cpp

ChangeLog: 

Move Facebook certificate load to facebook.cpp

-------------- next part --------------
============================================================
--- main.cpp	6fc8e8b73d3fcb67dbaed026814f913bfc46f4dd
+++ main.cpp	417f0eae2062719610348e8f69a0496ebd2c25d6
@@ -441,7 +441,6 @@ GlooxMessageHandler::GlooxMessageHandler
 	capsCache["_default"]=0;
 	
 	loadConfigFile();
-	loadProtocol();
 	
 	Log().Get("gloox") << "connecting to: " << m_configuration.server << " as " << m_configuration.jid << " with password " << m_configuration.password;
 	j = new HiComponent("jabber:component:accept",m_configuration.server,m_configuration.jid,m_configuration.password,m_configuration.port);
@@ -453,6 +452,7 @@ GlooxMessageHandler::GlooxMessageHandler
 	m_userManager = new UserManager(this);
 
 	initPurple();
+	loadProtocol();
 
 	m_discoHandler=new GlooxDiscoHandler(this);
  	j->removeIqHandler(XMLNS_DISCO_INFO);
@@ -1109,25 +1109,7 @@ bool GlooxMessageHandler::initPurple(){
 // 			}
 // 		}
 
-	PurpleCertificatePool *tls_peers;
-	tls_peers = purple_certificate_find_pool("x509", "tls_peers");
-	if (!purple_certificate_pool_contains(tls_peers, "login.facebook.com")){
-		PurpleCertificateScheme *x509;
-		PurpleCertificate *crt;
-
-		/* Load the scheme of our tls_peers pool (ought to be x509) */
-		x509 = purple_certificate_pool_get_scheme(tls_peers);
-
-		/* Now load the certificate from disk */
-		crt = purple_certificate_import(x509, "certificate.pem");
-		purple_certificate_pool_store(tls_peers, "login.facebook.com", crt);
-
-		/* And this certificate is not needed any more */
-		purple_certificate_destroy(crt);
 	}
-
-
-	}
 	return ret;
 }
 
============================================================
--- protocols/facebook.cpp	1d2b8a9186488a36614f11143ad933e569d8d83b
+++ protocols/facebook.cpp	77e6586fa67629e4052c69e42848c9ad3c6bd4d1
@@ -32,6 +32,25 @@ FacebookProtocol::FacebookProtocol(Gloox
 	m_buddyFeatures.push_back("http://jabber.org/protocol/disco#info");
 	m_buddyFeatures.push_back("http://jabber.org/protocol/caps");
 	m_buddyFeatures.push_back("http://jabber.org/protocol/chatstates");
+
+	// load certificate from certificate.pem
+	PurpleCertificatePool *tls_peers;
+	tls_peers = purple_certificate_find_pool("x509", "tls_peers");
+	if (!purple_certificate_pool_contains(tls_peers, "login.facebook.com")){
+		PurpleCertificateScheme *x509;
+		PurpleCertificate *crt;
+
+		/* Load the scheme of our tls_peers pool (ought to be x509) */
+		x509 = purple_certificate_pool_get_scheme(tls_peers);
+
+		/* Now load the certificate from disk */
+		crt = purple_certificate_import(x509, "certificate.pem");
+		purple_certificate_pool_store(tls_peers, "login.facebook.com", crt);
+
+		/* And this certificate is not needed any more */
+		purple_certificate_destroy(crt);
+	}
+
 // 	m_buddyFeatures.push_back("http://jabber.org/protocol/si/profile/file-transfer");
 // 	m_buddyFeatures.push_back("http://jabber.org/protocol/bytestreams");
 // 	m_buddyFeatures.push_back("http://jabber.org/protocol/si");


More information about the Commits mailing list