Use SwiftFormat version 0.49.x and enable some new rules (#527)
This commit is contained in:
parent
b62c5fa2e5
commit
cdedff0d4d
32 changed files with 139 additions and 126 deletions
|
|
@ -46,7 +46,7 @@ struct GopenPGPInterface: PGPInterface {
|
|||
|
||||
func extractKeysFromArmored(str: String) -> [String] {
|
||||
var keys: [String] = []
|
||||
var key: String = ""
|
||||
var key = ""
|
||||
for line in str.splitByNewline() {
|
||||
if line.trimmed.uppercased().hasPrefix("-----BEGIN PGP") {
|
||||
key = ""
|
||||
|
|
@ -100,7 +100,7 @@ struct GopenPGPInterface: PGPInterface {
|
|||
throw AppError.decryption
|
||||
}
|
||||
|
||||
let message = createPgpMessage(from: encryptedData)
|
||||
let message = createPGPMessage(from: encryptedData)
|
||||
return try keyRing.decrypt(message, verifyKey: nil, verifyTime: 0).data
|
||||
} catch {
|
||||
throw Self.errorMapping[error.localizedDescription, default: error]
|
||||
|
|
@ -148,7 +148,7 @@ struct GopenPGPInterface: PGPInterface {
|
|||
publicKeys.keys.map { $0.suffix(8).uppercased() }
|
||||
}
|
||||
|
||||
private func createPgpMessage(from encryptedData: Data) -> CryptoPGPMessage? {
|
||||
private func createPGPMessage(from encryptedData: Data) -> CryptoPGPMessage? {
|
||||
// Important note:
|
||||
// Even if Defaults.encryptInArmored is true now, it could be different during the encryption.
|
||||
var error: NSError?
|
||||
|
|
|
|||
|
|
@ -18,8 +18,8 @@ public class PGPAgent {
|
|||
}
|
||||
|
||||
public func initKeys() throws {
|
||||
guard let publicKey: String = keyStore.get(for: PgpKey.PUBLIC.getKeychainKey()),
|
||||
let privateKey: String = keyStore.get(for: PgpKey.PRIVATE.getKeychainKey()) else {
|
||||
guard let publicKey: String = keyStore.get(for: PGPKey.PUBLIC.getKeychainKey()),
|
||||
let privateKey: String = keyStore.get(for: PGPKey.PRIVATE.getKeychainKey()) else {
|
||||
pgpInterface = nil
|
||||
throw AppError.keyImport
|
||||
}
|
||||
|
|
@ -127,8 +127,8 @@ public class PGPAgent {
|
|||
}
|
||||
|
||||
public var isPrepared: Bool {
|
||||
keyStore.contains(key: PgpKey.PUBLIC.getKeychainKey())
|
||||
&& keyStore.contains(key: PgpKey.PRIVATE.getKeychainKey())
|
||||
keyStore.contains(key: PGPKey.PUBLIC.getKeychainKey())
|
||||
&& keyStore.contains(key: PGPKey.PRIVATE.getKeychainKey())
|
||||
}
|
||||
|
||||
private func checkAndInit() throws {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue