Fixed access to TDE wallets created before R14.0.6 that uses special non-ascii characters in their password.

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
pull/15/head
Michele Calgaro 6 years ago
parent cfb7075fa2
commit 6b3ce66088
Signed by: MicheleC
GPG Key ID: 2A75B7CA8ADED5CF

@ -478,10 +478,15 @@ int TDEWalletD::internalOpen(const TQCString& appid, const TQString& wallet, boo
if (kpd->exec() == KDialog::Accepted) { if (kpd->exec() == KDialog::Accepted) {
p = kpd->password().utf8(); p = kpd->password().utf8();
int rc = b->open(TQByteArray().duplicate(p, p.length())); int rc = b->open(TQByteArray().duplicate(p, p.length()));
if (!b->isOpen()) {
// For compatibility with TDE << T14.0.6, try ascii() as fallback option in case of errors
p = kpd->password().ascii();
rc = b->open(TQByteArray().duplicate(p, p.length()));
if (!b->isOpen()) { if (!b->isOpen()) {
kpd->setPrompt(i18n("<qt>Error opening the wallet '<b>%1</b>'. Please try again.<br>(Error code %2: %3)").arg(TQStyleSheet::escape(wallet)).arg(rc).arg(TDEWallet::Backend::openRCToString(rc))); kpd->setPrompt(i18n("<qt>Error opening the wallet '<b>%1</b>'. Please try again.<br>(Error code %2: %3)").arg(TQStyleSheet::escape(wallet)).arg(rc).arg(TDEWallet::Backend::openRCToString(rc)));
kpd->clearPassword(); kpd->clearPassword();
} }
}
} else { } else {
break; break;
} }

Loading…
Cancel
Save