summaryrefslogtreecommitdiffstats
path: root/libkpgp/kpgp.cpp
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2018-11-30 16:17:09 +0100
committerSlávek Banko <slavek.banko@axis.cz>2018-11-30 16:24:31 +0100
commit6492b716b372d0f929f98a2965e00e10a0355204 (patch)
tree45a233b3f64424bea40533578150d392fa07b704 /libkpgp/kpgp.cpp
parent2e5de46030e2354b851ba731f6c76ac30a2e8a3b (diff)
downloadtdepim-6492b716b372d0f929f98a2965e00e10a0355204.tar.gz
tdepim-6492b716b372d0f929f98a2965e00e10a0355204.zip
Improved previous commit
Signed-off-by: Slávek Banko <slavek.banko@axis.cz> Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Diffstat (limited to 'libkpgp/kpgp.cpp')
-rw-r--r--libkpgp/kpgp.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/libkpgp/kpgp.cpp b/libkpgp/kpgp.cpp
index a4242957..4d5120d0 100644
--- a/libkpgp/kpgp.cpp
+++ b/libkpgp/kpgp.cpp
@@ -55,7 +55,7 @@ Module::Module()
mPublicKeysCached(false),
mSecretKeys(),
mSecretKeysCached(false),
- passphrase(0), havePassPhrase(false)
+ passphrase(TQString::null), havePassPhrase(false)
{
if (!kpgpObject) {
kdDebug(5100) << "creating new pgp object" << endl;
@@ -230,8 +230,8 @@ Module::wipePassPhrase(bool freeMem)
if (!passphrase.isEmpty()) {
passphrase.fill(' ');
}
- if (freeMem && !passphrase.isNull()) {
- passphrase = TQString();
+ if (freeMem) {
+ passphrase.truncate(0);
}
havePassPhrase = false;
}
@@ -830,13 +830,13 @@ Module::getAsciiPublicKey(const KeyID& keyID)
}
-bool Module::setPassPhrase(const TQString& aPass)
+bool Module::setPassPhrase(const TQString &aPass)
{
// null out old buffer before we touch the new string. So in case
// aPass isn't properly null-terminated, we don't leak secret data.
wipePassPhrase();
- if (!aPass.isNull())
+ if (!aPass.isEmpty())
{
if (aPass.length() >= 1024) {
// rediculously long passphrase.