From 799b00211dc1458cdcf2f7cfc5e27b7830543610 Mon Sep 17 00:00:00 2001 From: Andy Matuschak Date: Thu, 20 Aug 2009 23:24:13 -0700 Subject: [PATCH] Fixing Bug #338324: "Unsigned updates delivered over https fail" Silly boolean logic error. --- SUBasicUpdateDriver.m | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/SUBasicUpdateDriver.m b/SUBasicUpdateDriver.m index 6a7a854b..c799e491 100644 --- a/SUBasicUpdateDriver.m +++ b/SUBasicUpdateDriver.m @@ -167,9 +167,10 @@ { // 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"]) || !([downloadURL isFileURL] && [appcastURL isFileURL]) || [host publicDSAKey]) + if (!(([[downloadURL scheme] isEqualToString:@"https"] && [[appcastURL scheme] isEqualToString:@"https"]) || + ([downloadURL isFileURL] && [appcastURL isFileURL]))) { - if (![SUDSAVerifier validatePath:downloadPath withEncodedDSASignature:[updateItem DSASignature] withPublicDSAKey:[host publicDSAKey]]) + if (![host publicDSAKey] || ![SUDSAVerifier validatePath:downloadPath withEncodedDSASignature:[updateItem DSASignature] withPublicDSAKey:[host publicDSAKey]]) { [self abortUpdateWithError:[NSError errorWithDomain:SUSparkleErrorDomain code:SUSignatureError userInfo:[NSDictionary dictionaryWithObject:@"The update is improperly signed." forKey:NSLocalizedDescriptionKey]]]; return;