Fixing Bug #416798: "Sparkle should warn developers if the app has no public key and the appcast isn't https://"

This commit is contained in:
Andy Matuschak committed 2009-08-27 00:02:10 -07:00
1 parent 43a603c1cc
commit d62e47cd2e
1 file changed
+5
+5
View File
@@ -69,6 +69,11 @@ static NSString *SUUpdaterDefaultsObservationContext = @"SUUpdaterDefaultsObserv
[sharedUpdaters setObject:self forKey:[NSValue valueWithNonretainedObject:bundle]];
host = [[SUHost alloc] initWithBundle:bundle];
[self registerAsObserver];
// Saving-the-developer-from-a-stupid-mistake-check:
if (![[[self feedURL] scheme] isEqualToString:@"https"] && ![host publicDSAKey])
NSRunAlertPanel(@"Insecure update error!", @"For security reasons, you need to distribute your appcast over SSL or sign your updates. See Sparkle's documentation for more information.", @"OK", nil, nil);
// This runs the permission prompt if needed, but never before the app has finished launching because the runloop won't run before that
[self performSelector:@selector(startUpdateCycle) withObject:nil afterDelay:0];
}