adium 5625:f23fc7dd5575: Use a non-deprecated function to obtain...
commits at adium.im
commits at adium.im
Fri Jul 5 20:26:18 UTC 2013
details: http://hg.adium.im/adium/rev/f23fc7dd5575
revision: 5625:f23fc7dd5575
branch: adium-1.5.8
author: Thijs Alkemade <me at thijsalkema.de>
date: Fri Jul 05 22:23:43 2013 +0200
Use a non-deprecated function to obtain a SecPolicy for SSL.
This should fix problems with Adium and other applications hanging and possible keychain corruption on 10.7 when trusting an untrusted certificate. Fixes #16365
diffs (41 lines):
diff -r f808fb8a9f35 -r f23fc7dd5575 Plugins/Purple Service/AIPurpleCertificateTrustWarningAlert.m
--- a/Plugins/Purple Service/AIPurpleCertificateTrustWarningAlert.m Wed Jul 03 12:11:34 2013 +0100
+++ b/Plugins/Purple Service/AIPurpleCertificateTrustWarningAlert.m Fri Jul 05 22:23:43 2013 +0200
@@ -205,28 +205,6 @@
CFRelease(policyRef);
}
-/*
- * Function: SSLSecPolicyCopy
- * Purpose:
- * Returns a copy of the SSL policy.
- */
-static SecPolicyRef SSLSecPolicyCopy()
-{
- SecPolicyRef policy = NULL;
- SecPolicySearchRef policy_search;
- OSStatus status;
-
- status = SecPolicySearchCreate(CSSM_CERT_X_509v3, &CSSMOID_APPLE_TP_SSL, NULL, &policy_search);
- if (status == noErr) {
- status = SecPolicySearchCopyNext(policy_search, &policy);
- if (status != noErr) policy = NULL;
- }
-
- CFRelease(policy_search);
-
- return policy;
-}
-
- (void)runTrustPanelOnWindow:(NSWindow *)window
{
SFCertificateTrustPanel *trustPanel = [[SFCertificateTrustPanel alloc] init];
@@ -251,7 +229,7 @@
[trustPanel setAlternateButtonTitle:AILocalizedString(@"Cancel",nil)];
[trustPanel setShowsHelp:YES];
- SecPolicyRef sslPolicy = SSLSecPolicyCopy();
+ SecPolicyRef sslPolicy = SecPolicyCreateSSL(TRUE, (CFStringRef)hostname);
if (sslPolicy) {
[trustPanel setPolicies:(id)sslPolicy];
CFRelease(sslPolicy);
More information about the commits
mailing list