From 3094146c13bdd738dd4343d57dd2a345db926b43 Mon Sep 17 00:00:00 2001 From: Gioacchino Mazzurco Date: Tue, 28 Aug 2018 14:35:29 +0200 Subject: [PATCH] RsLoginHelper::attemptLogin clear cached passphrase after usage Thanks Cyril for suggestion --- libretroshare/src/rsserver/rsinit.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/libretroshare/src/rsserver/rsinit.cc b/libretroshare/src/rsserver/rsinit.cc index bad35c91a..3a76fd79a 100644 --- a/libretroshare/src/rsserver/rsinit.cc +++ b/libretroshare/src/rsserver/rsinit.cc @@ -1940,10 +1940,11 @@ RsInit::LoadCertificateStatus RsLoginHelper::attemptLogin( if(!rsNotify->cachePgpPassphrase(password)) return RsInit::ERR_UNKOWN; if(!rsNotify->setDisableAskPassword(true)) return RsInit::ERR_UNKOWN; if(!RsAccounts::SelectAccount(account)) return RsInit::ERR_UNKOWN; - std::string ignore; + std::string _ignore_lockFilePath; RsInit::LoadCertificateStatus ret = - RsInit::LockAndLoadCertificates(false, ignore); - rsNotify->setDisableAskPassword(false); + RsInit::LockAndLoadCertificates(false, _ignore_lockFilePath); + if(!rsNotify->setDisableAskPassword(false)) return RsInit::ERR_UNKOWN; + if(!rsNotify->clearPgpPassphrase()) return RsInit::ERR_UNKOWN; if(ret != RsInit::OK) return ret; if(RsControl::instance()->StartupRetroShare() == 1) return RsInit::OK; return RsInit::ERR_UNKOWN;