diff --git a/Sparkle/SUAppcastItem.m b/Sparkle/SUAppcastItem.m index 359a5516..f265b54e 100644 --- a/Sparkle/SUAppcastItem.m +++ b/Sparkle/SUAppcastItem.m @@ -156,7 +156,7 @@ self.fileURL = [NSURL URLWithString:fileURLString]; } if (enclosure) { - self.signatures = [[SUSignatures alloc] initWithDsa:[enclosure objectForKey:SUAppcastAttributeDSASignature] ed:nil]; + self.signatures = [[SUSignatures alloc] initWithDsa:[enclosure objectForKey:SUAppcastAttributeDSASignature] ed:[enclosure objectForKey:SUAppcastAttributeEDSignature]]; self.osString = [enclosure objectForKey:SUAppcastAttributeOsType]; } diff --git a/Sparkle/SUConstants.h b/Sparkle/SUConstants.h index 5ff8fb01..af5b04d5 100644 --- a/Sparkle/SUConstants.h +++ b/Sparkle/SUConstants.h @@ -41,6 +41,7 @@ extern NSString *const SUSkippedVersionKey; extern NSString *const SUScheduledCheckIntervalKey; extern NSString *const SULastCheckTimeKey; extern NSString *const SUExpectsDSASignatureKey; +extern NSString *const SUExpectsEDSignatureKey; extern NSString *const SUPublicDSAKeyKey; extern NSString *const SUPublicDSAKeyFileKey; extern NSString *const SUAutomaticallyUpdateKey; @@ -64,6 +65,7 @@ extern NSString *const SURelaunchToolNameKey __attribute__((deprecated("This key extern NSString *const SUAppcastAttributeDeltaFrom; extern NSString *const SUAppcastAttributeDSASignature; +extern NSString *const SUAppcastAttributeEDSignature; extern NSString *const SUAppcastAttributeShortVersionString; extern NSString *const SUAppcastAttributeVersion; extern NSString *const SUAppcastAttributeOsType; diff --git a/Sparkle/SUConstants.m b/Sparkle/SUConstants.m index fc4e8e67..889b7c66 100644 --- a/Sparkle/SUConstants.m +++ b/Sparkle/SUConstants.m @@ -33,6 +33,7 @@ NSString *const SUSkippedVersionKey = @"SUSkippedVersion"; NSString *const SUScheduledCheckIntervalKey = @"SUScheduledCheckInterval"; NSString *const SULastCheckTimeKey = @"SULastCheckTime"; NSString *const SUExpectsDSASignatureKey = @"SUExpectsDSASignature"; +NSString *const SUExpectsEDSignatureKey = @"SUExpectsEDSignatureKey"; NSString *const SUPublicDSAKeyKey = @"SUPublicDSAKey"; NSString *const SUPublicDSAKeyFileKey = @"SUPublicDSAKeyFile"; NSString *const SUAutomaticallyUpdateKey = @"SUAutomaticallyUpdate"; @@ -54,6 +55,7 @@ NSString *const SURelaunchToolNameKey = @"SURelaunchToolName"; NSString *const SUAppcastAttributeDeltaFrom = @"sparkle:deltaFrom"; NSString *const SUAppcastAttributeDSASignature = @"sparkle:dsaSignature"; +NSString *const SUAppcastAttributeEDSignature = @"sparkle:edSignature"; NSString *const SUAppcastAttributeShortVersionString = @"sparkle:shortVersionString"; NSString *const SUAppcastAttributeVersion = @"sparkle:version"; NSString *const SUAppcastAttributeOsType = @"sparkle:os"; diff --git a/Sparkle/SUSignatures.h b/Sparkle/SUSignatures.h index 5c54e6d3..b2f3c4fd 100644 --- a/Sparkle/SUSignatures.h +++ b/Sparkle/SUSignatures.h @@ -11,6 +11,7 @@ NS_ASSUME_NONNULL_BEGIN @interface SUSignatures : NSObject { + unsigned char ed25519_signature[64]; } @property (nullable) NSString *dsaSignature; diff --git a/Sparkle/SUSignatures.m b/Sparkle/SUSignatures.m index 8c4dce6e..55535751 100644 --- a/Sparkle/SUSignatures.m +++ b/Sparkle/SUSignatures.m @@ -17,6 +17,17 @@ self = [super init]; if (self) { self.dsaSignature = maybeDsa; + if (maybeEd25519 != nil) { + NSString *ed = maybeEd25519; + NSData *data; + if (@available(macOS 10.9, *)) { + data = [[NSData alloc] initWithBase64EncodedString:ed options:0]; + } else { + data = [[NSData alloc] initWithBase64Encoding:ed]; + } + assert(64 == sizeof(self->ed25519_signature)); + [data getBytes:self->ed25519_signature length:sizeof(self->ed25519_signature)]; + } } return self; }