Minor naming improvement

This commit is contained in:
Tamás Lustyik committed 2018-05-13 15:50:46 +02:00
1 parent a19dfb2be0
commit b48e80aa27
2 files changed
+6 -6

No files matched your search

+3 -3
View File
@@ -5,8 +5,8 @@
import Foundation
func loadPrivateKey(privateKeyPath: URL) throws -> SecKey {
let data = try Data(contentsOf: privateKeyPath);
func loadPrivateKey(at privateKeyURL: URL) throws -> SecKey {
let data = try Data(contentsOf: privateKeyURL);
var cfitems: CFArray? = nil;
var format = SecExternalFormat.formatOpenSSL;
@@ -14,7 +14,7 @@ func loadPrivateKey(privateKeyPath: URL) throws -> SecKey {
let status = SecItemImport(data as CFData, nil, &format, &type, SecItemImportExportFlags(rawValue: UInt32(0)), nil, nil, &cfitems);
if (status != errSecSuccess || cfitems == nil) {
print("Private DSA key file", privateKeyPath, "exists, but it could not be read. SecItemImport error", status);
print("Private DSA key file", privateKeyURL.path, "exists, but it could not be read. SecItemImport error", status);
throw NSError(domain: SUSparkleErrorDomain, code: Int(OSStatus(SUError.signatureError.rawValue)), userInfo: nil);
}
+3 -3
View File
@@ -22,11 +22,11 @@ func main() {
exit(1);
}
let privateKeyPath = URL(fileURLWithPath: args[1]);
let privateKeyURL = URL(fileURLWithPath: args[1]);
let archivesSourceDir = URL(fileURLWithPath: args[2], isDirectory:true);
do {
let privateKey = try loadPrivateKey(privateKeyPath: privateKeyPath);
let privateKey = try loadPrivateKey(at: privateKeyURL);
do {
let allUpdates = try makeAppcast(archivesSourceDir: archivesSourceDir, privateKey: privateKey, verbose:verbose);
@@ -40,7 +40,7 @@ func main() {
exit(1);
}
} catch {
print("Unable to load DSA private key from", privateKeyPath.path, "\n", error);
print("Unable to load DSA private key from", privateKeyURL.path, "\n", error);
exit(1);
}
}