Wrap GopenPGP errors into more understandable app errors
This commit is contained in:
parent
fa820e277f
commit
44cb864642
5 changed files with 23 additions and 4 deletions
|
|
@ -86,7 +86,7 @@ class PGPAgentTest: XCTestCase {
|
|||
try importKeys(ED25519.publicKey, RSA2048.privateKey)
|
||||
XCTAssert(pgpAgent.isPrepared)
|
||||
XCTAssertThrowsError(try basicEncryptDecrypt(using: pgpAgent)) {
|
||||
XCTAssert($0.localizedDescription.contains("openpgp: incorrect key"))
|
||||
XCTAssertEqual($0 as! AppError, AppError.KeyExpiredOrIncompatible)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -128,7 +128,7 @@ class PGPAgentTest: XCTestCase {
|
|||
|
||||
// Provide the wrong passphrase.
|
||||
XCTAssertThrowsError(try basicEncryptDecrypt(using: pgpAgent, requestPassphrase: provideIncorrectPassphrase)) {
|
||||
XCTAssert($0.localizedDescription.contains("openpgp: invalid data: private key checksum failure"))
|
||||
XCTAssertEqual($0 as! AppError, AppError.WrongPassphrase)
|
||||
}
|
||||
XCTAssertEqual(passphraseRequestCalledCount, 2)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue