From d62e47cd2e30e0ba6a66375cb89f719c5230c808 Mon Sep 17 00:00:00 2001 From: Andy Matuschak Date: Thu, 27 Aug 2009 00:02:10 -0700 Subject: [PATCH] Fixing Bug #416798: "Sparkle should warn developers if the app has no public key and the appcast isn't https://" --- SUUpdater.m | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/SUUpdater.m b/SUUpdater.m index 7b5b5989..75a2c94c 100644 --- a/SUUpdater.m +++ b/SUUpdater.m @@ -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]; }