From 85bb5664c64a51f774b662333cacb29cecdd35c3 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Mon, 27 Jan 2014 16:25:07 +0100 Subject: [PATCH 1/2] DeletePasswordJob: forward the settings to the WriteJob And always remove the password from the insecure storage --- keychain.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/keychain.cpp b/keychain.cpp index 70ea7e0..8ae88d1 100644 --- a/keychain.cpp +++ b/keychain.cpp @@ -154,6 +154,8 @@ void DeletePasswordJob::doStart() { //In all current implementations, this deletes the entry so this is sufficient WritePasswordJob* job = new WritePasswordJob( service(), this ); connect( job, SIGNAL(finished(QKeychain::Job*)), d, SLOT(jobFinished(QKeychain::Job*)) ); + job->setInsecureFallback(true); + job->setSettings(settings()); job->setKey( d->key ); job->start(); } From 8150f61a487e6272d425d8a0626c30778f4bd8e7 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Mon, 27 Jan 2014 16:27:42 +0100 Subject: [PATCH 2/2] DeletePasswordJob: Start the WriteJob immediatly We want that if one delete, then read the password directly after, it do not reuse the deleted password. --- keychain.cpp | 2 +- keychain.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/keychain.cpp b/keychain.cpp index 8ae88d1..61127f3 100644 --- a/keychain.cpp +++ b/keychain.cpp @@ -157,7 +157,7 @@ void DeletePasswordJob::doStart() { job->setInsecureFallback(true); job->setSettings(settings()); job->setKey( d->key ); - job->start(); + job->doStart(); } QString DeletePasswordJob::key() const { diff --git a/keychain.h b/keychain.h index 4f00954..dd3a4c2 100644 --- a/keychain.h +++ b/keychain.h @@ -117,6 +117,7 @@ protected: private: friend class QKeychain::JobExecutor; friend class QKeychain::WritePasswordJobPrivate; + friend class DeletePasswordJob; WritePasswordJobPrivate* const d; };