mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-06-27 08:01:21 -04:00
SSH Agent: Expect passphrases to be in UTF-8
The previous default was to expect passphrases to be ASCII or rather Latin-1. It would be reasonable to expect modern keys to use UTF-8 instead. This is a non-breaking change if passphrases only use characters that fall within ASCII. Fixes #2102
This commit is contained in:
parent
c67f7afa49
commit
3727d37101
3 changed files with 28 additions and 1 deletions
|
@ -350,7 +350,7 @@ bool OpenSSHKey::openPrivateKey(const QString& passphrase)
|
|||
QByteArray decryptKey;
|
||||
decryptKey.fill(0, cipher->keySize() + cipher->blockSize());
|
||||
|
||||
QByteArray phraseData = passphrase.toLatin1();
|
||||
QByteArray phraseData = passphrase.toUtf8();
|
||||
if (bcrypt_pbkdf(phraseData, salt, decryptKey, rounds) < 0) {
|
||||
m_error = tr("Key derivation failed, key file corrupted?");
|
||||
return false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue