From c3cdbf46cb2ac65044e6ab3adaa49a0f8d137ec1 Mon Sep 17 00:00:00 2001 From: Zorg Date: Sat, 24 Jul 2021 15:46:14 -0700 Subject: [PATCH] Don't allow an app to use an invalid EdDSA public key --- Sparkle/SPUUpdater.m | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Sparkle/SPUUpdater.m b/Sparkle/SPUUpdater.m index b23f6b41..f0a1a47f 100644 --- a/Sparkle/SPUUpdater.m +++ b/Sparkle/SPUUpdater.m @@ -258,6 +258,14 @@ NSString *const SUUpdaterAppcastNotificationKey = @"SUUpdaterAppCastNotification return NO; } } + + // Don't allow invalid EdDSA public keys + if (publicKeys.ed25519PubKeyStatus == SUSigningInputStatusInvalid) { + if (error != NULL) { + *error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUNoPublicDSAFoundError userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:@"The EdDSA public key is not valid for %@.", hostName] }]; + } + return NO; + } if (!hasAnyPublicKey) { if ((feedURL != nil && !servingOverHttps) || ![SUCodeSigningVerifier bundleAtURLIsCodeSigned:[[self hostBundle] bundleURL]]) {