Use createPGPMessage instead of CryptoNewPGPMessage to support ASCII-armored password with YubiKey (#658)
This commit is contained in:
parent
5bf7ff2da7
commit
c5d9d258d8
2 changed files with 13 additions and 13 deletions
|
|
@ -206,7 +206,7 @@ func verifyPin(smartCard: YKFSmartCardInterface, pin: String) async throws {
|
|||
|
||||
func decipher(smartCard: YKFSmartCardInterface, ciphertext: Data, chained: Bool) async throws -> Data {
|
||||
var error: NSError?
|
||||
let message = CryptoNewPGPMessage(ciphertext)
|
||||
let message = createPGPMessage(from: ciphertext)
|
||||
guard let mpi1 = Gopenpgp.HelperPassGetEncryptedMPI1(message, &error) else {
|
||||
throw AppError.yubiKey(.decipher(message: "Failed to get encrypted MPI."))
|
||||
}
|
||||
|
|
@ -225,7 +225,7 @@ func decipher(smartCard: YKFSmartCardInterface, ciphertext: Data, chained: Bool)
|
|||
}
|
||||
|
||||
func decryptPassword(deciphered: Data, ciphertext: Data) throws -> String {
|
||||
let message = CryptoNewPGPMessage(ciphertext)
|
||||
let message = createPGPMessage(from: ciphertext)
|
||||
|
||||
guard let algoByte = deciphered.first, let algo = symmetricKeyIDNameDict[algoByte] else {
|
||||
throw AppError.yubiKey(.decipher(message: "Failed to new session key."))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue