From 19be83b15fee57823bcbd87334b98ec542793315 Mon Sep 17 00:00:00 2001 From: Kornel Date: Sun, 16 Sep 2018 11:19:28 +0100 Subject: [PATCH] Emit edSignature in the appcast --- generate_appcast/ArchiveItem.swift | 4 ++-- generate_appcast/FeedXML.swift | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/generate_appcast/ArchiveItem.swift b/generate_appcast/ArchiveItem.swift index 9ddc2e91..e47d9790 100644 --- a/generate_appcast/ArchiveItem.swift +++ b/generate_appcast/ArchiveItem.swift @@ -83,8 +83,8 @@ class ArchiveItem: CustomStringConvertible { throw makeError(code: .unarchivingError, "No Version \(kCFBundleVersionKey as String? ?? "missing kCFBundleVersionKey") \(appPath)"); } let shortVersion = infoPlist["CFBundleShortVersionString"] as? String; - let publicEdKey = infoPlist["SUPublicEDKey"] as? String; - let supportsDSA = infoPlist["SUPublicDSAKey"] != nil || infoPlist["SUPublicDSAKeyFile"] != nil; + let publicEdKey = infoPlist[SUPublicEDKeyKey] as? String; + let supportsDSA = infoPlist[SUPublicDSAKeyKey] != nil || infoPlist[SUPublicDSAKeyFileKey] != nil; var feedURL:URL? = nil; if let feedURLStr = infoPlist["SUFeedURL"] as? String { diff --git a/generate_appcast/FeedXML.swift b/generate_appcast/FeedXML.swift index 29e95266..f1a28d4d 100644 --- a/generate_appcast/FeedXML.swift +++ b/generate_appcast/FeedXML.swift @@ -147,6 +147,9 @@ func writeAppcast(appcastDestPath: URL, updates: [ArchiveItem]) throws { XMLNode.attribute(withName: "length", stringValue: String(update.fileSize)) as! XMLNode, XMLNode.attribute(withName: "type", stringValue: update.mimeType) as! XMLNode, ]; + if let sig = update.edSignature { + attributes.append(XMLNode.attribute(withName: "sparkle:edSignature", uri: sparkleNS, stringValue: sig) as! XMLNode); + } if let sig = update.dsaSignature { attributes.append(XMLNode.attribute(withName: "sparkle:dsaSignature", uri: sparkleNS, stringValue: sig) as! XMLNode); } @@ -170,6 +173,9 @@ func writeAppcast(appcastDestPath: URL, updates: [ArchiveItem]) throws { XMLNode.attribute(withName: "length", stringValue: String(delta.fileSize)) as! XMLNode, XMLNode.attribute(withName: "type", stringValue: "application/octet-stream") as! XMLNode, ]; + if let sig = delta.edSignature { + attributes.append(XMLNode.attribute(withName: "sparkle:edSignature", uri: sparkleNS, stringValue: sig) as! XMLNode); + } if let sig = delta.dsaSignature { attributes.append(XMLNode.attribute(withName: "sparkle:dsaSignature", uri: sparkleNS, stringValue: sig) as! XMLNode); }