Skip to content

Commit

Permalink
Error cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
phil1995 committed Jan 3, 2024
1 parent ebde629 commit 8ebb9b5
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public enum JWEHelper {
let payloadMasterkey = try JSONDecoder().decode(PayloadMasterkey.self, from: payload.data())

guard let masterkeyData = Data(base64Encoded: payloadMasterkey.key) else {
throw VaultManagerError.invalidPayloadMasterkey
throw JWEHelperError.invalidMasterkeyPayload
}
return Masterkey.createFromRaw(rawKey: [UInt8](masterkeyData))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ public enum VaultManagerError: Error {
case vaultVersionNotSupported
case fileProviderDomainNotFound
case moveVaultInsideItself
case invalidDecrypter
case invalidPayloadMasterkey
case missingVaultConfigToken
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ final class JWEHelperTests: XCTestCase {
let privateKey = try P384.KeyAgreement.PrivateKey(pkcs8DerRepresentation: data)

XCTAssertThrowsError(try JWEHelper.decryptVaultKey(jwe: jwe, with: privateKey)) { error in
guard case VaultManagerError.invalidPayloadMasterkey = error else {
guard case JWEHelperError.invalidMasterkeyPayload = error else {
XCTFail("Unexpected error: \(error)")
return
}
Expand Down

0 comments on commit 8ebb9b5

Please sign in to comment.