Changeset 22501
- Timestamp:
- 01/28/2008 05:20:57 PM (10 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/adium-1.2/Plugins/Purple Service/AIPurpleCertificateTrustWarningAlert.m
r22481 r22501 17 17 #import <AIUtilities/AITigerCompatibility.h> 18 18 19 #define ALWAYS_SHOW_TRUST_WARNING19 //#define ALWAYS_SHOW_TRUST_WARNING 20 20 21 21 static NSMutableDictionary *acceptedCertificates = nil; … … 37 37 @implementation AIPurpleCertificateTrustWarningAlert 38 38 39 + (void)displayTrustWarningAlertWithAccount:(AIAccount *)account40 hostname:(NSString *)hostname39 + (void)displayTrustWarningAlertWithAccount:(AIAccount *)account 40 hostname:(NSString *)hostname 41 41 certificates:(CFArrayRef)certs 42 42 resultCallback:(void (*)(gboolean trusted, void *userdata))_query_cert_cb 43 43 userData:(void*)ud 44 44 { 45 if([account isKindOfClass:[AIPurpleGTalkAccount class]]) 46 hostname = @"gmail.com"; // messed up certificate CN of gtalk 45 if ([hostname caseInsensitiveCompare:@"talk.google.com"] == NSOrderedSame) { 46 NSString *UID = [account UID]; 47 NSRange startOfDomain = [UID rangeOfString:@"@"]; 48 if (startOfDomain.location == NSNotFound || 49 ([[UID substringFromIndex:NSMaxRange(startOfDomain)] caseInsensitiveCompare:@"gmail.com"] == NSOrderedSame)) { 50 /* Google Talk accounts end up with a cert signed using gmail.com as the server. 51 * However, Google For Domains accounts are signed using talk.google.com. 52 */ 53 hostname = @"gmail.com"; 54 } 55 } 56 47 57 AIPurpleCertificateTrustWarningAlert *alert = [[self alloc] initWithAccount:account hostname:hostname certificates:certs resultCallback:_query_cert_cb userData:ud]; 48 58 [alert showWindow:nil]; … … 289 299 CFRelease(trustRef); 290 300 291 [parentWindow perform Selector:@selector(performClose:) withObject:nil afterDelay:0.0];301 [parentWindow performClose:nil]; 292 302 293 303 [self release];