Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added preprocessor defines to SUConstants.h for turning on/off DSA an…

…d downgrades. We let users downgrade using our URL scheme, and we warn them beforehand, so the downgrade possible attack paranoia gets in the way.
  • Loading branch information...
commit d0b802e09b48ed06c4a273d4129db8ccab26327c 1 parent 8c67631
@uliwitness uliwitness authored
View
2  SUBasicUpdateDriver.m
@@ -168,7 +168,7 @@ - (void)download:(NSURLDownload *)d decideDestinationWithSuggestedFilename:(NSSt
- (void)downloadDidFinish:(NSURLDownload *)d
{
- #if 0 // +++
+ #if !ENDANGER_USERS_WITH_INSECURE_UPDATES
// New in Sparkle 1.5: we're now checking signatures on all non-secure downloads, where "secure" is defined as both the appcast and the download being transmitted over SSL.
NSURL *downloadURL = [[d request] URL];
if (!(([[downloadURL scheme] isEqualToString:@"https"] && [[appcastURL scheme] isEqualToString:@"https"]) ||
View
2  SUConstants.h
@@ -10,6 +10,8 @@
#ifndef SUCONSTANTS_H
#define SUCONSTANTS_H
+#define ENDANGER_USERS_WITH_INSECURE_UPDATES 1
+#define PERMIT_AUTOMATED_DOWNGRADES 1
// -----------------------------------------------------------------------------
// Notifications:
View
2  SUPlainInstaller.m
@@ -51,6 +51,7 @@ + (void)_performInstallationWithInfo:(NSDictionary *)info
+ (void)performInstallationWithPath:(NSString *)path host:(SUHost *)host delegate:delegate synchronously:(BOOL)synchronously versionComparator:(id <SUVersionComparison>)comparator
{
// Prevent malicious downgrades:
+ #if !PERMIT_AUTOMATED_DOWNGRADES
if ([comparator compareVersion:[host version] toVersion:[[NSBundle bundleWithPath:path] objectForInfoDictionaryKey:@"CFBundleVersion"]] == NSOrderedDescending)
{
NSString * errorMessage = [NSString stringWithFormat:@"Sparkle Updater: Possible attack in progress! Attempting to \"upgrade\" from %@ to %@. Aborting update.", [host version], [[NSBundle bundleWithPath:path] objectForInfoDictionaryKey:@"CFBundleVersion"]];
@@ -58,6 +59,7 @@ + (void)performInstallationWithPath:(NSString *)path host:(SUHost *)host delegat
[self _finishInstallationWithResult:NO host:host error:error delegate:delegate];
return;
}
+ #endif
NSString *targetPath = [host installationPath];
NSString *tempName = [self temporaryNameForPath:targetPath];
View
2  SUUpdater.m
@@ -73,7 +73,7 @@ - (id)initForBundle:(NSBundle *)bundle
host = [[SUHost alloc] initWithBundle:bundle];
[self registerAsObserver];
-#if 0
+#if !ENDANGER_USERS_WITH_INSECURE_UPDATES
// 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);
Please sign in to comment.
Something went wrong with that request. Please try again.