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>
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
pull/16/head
Michele Calgaro 5 years ago committed by Slávek Banko
parent 7d8d7f102a
commit 987768c54d
Signed by: SlavekB
GPG Key ID: 608F5293A04BE668

@ -479,8 +479,14 @@ int TDEWalletD::internalOpen(const TQCString& appid, const TQString& wallet, boo
p = kpd->password();
int rc = b->open(TQByteArray().duplicate(p, strlen(p)));
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->clearPassword();
// For compatibility with TDE << R14.0.6, try ascii() as fallback option in case of errors
TQString pw8Bit = TQString::fromLocal8Bit(p);
p = pw8Bit.ascii();
rc = b->open(TQByteArray().duplicate(p, strlen(p)));
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->clearPassword();
}
}
} else {
break;

Loading…
Cancel
Save