I add another piece to the bug 2961 puzzle. I did not test the result. By the way, I did not find out if anyone else uses the finished() signal from certmanager/lib/ui/passphrasedialog.h – whether changing the parameter may cause additional problems.
I add another piece to the bug 2961 puzzle. I did not test the result. By the way, I did not find out if anyone else uses the `finished()` signal from [`certmanager/lib/ui/passphrasedialog.h`](src/branch/master/certmanager/lib/ui/passphrasedialog.h#L72) – whether changing the parameter may cause additional problems.
SlavekB
added this to the R14.1.0 release milestone 5 years ago
IMO, const modifier is not required. Gives more freedom to user of the function without requiring cast.
In tdelibs and many other places, TQString is used.
IMO, const modifier is not required. Gives more freedom to user of the function without requiring cast.
In tdelibs and many other places, TQString is used.
IMO, const modifier is not required. Gives more freedom to user of the function without requiring cast.
In tdelibs and many other places, TQString is used.
IMO, const modifier is not required. Gives more freedom to user of the function without requiring cast.
In tdelibs and many other places, TQString is used.
Being an object, passphrase will be deallocated when it leaves its scope. There should be no need for explicitly replace it with an empty TQString.
As sidenote, freeMem logic may no longer be necessary, perhaps?
Being an object, passphrase will be deallocated when it leaves its scope. There should be no need for explicitly replace it with an empty TQString.
As sidenote, freeMem logic may no longer be necessary, perhaps?
We are not using malloc any more in the body. So a simpler version of the function could be used, IMO.
To consider if "havePassPhrase" is still required.
```
bool Module::setPassPhrase(const TQString& aPass)
{
passphrase = aPass;
havePassPhrase = true;
return true;
}
```
IMO, const modifier is not required. Gives more freedom to user of the function without requiring cast. In tdelibs and many other places, TQString is used.
IMO, const modifier is not required. Gives more freedom to user of the function without requiring cast. In tdelibs and many other places, TQString is used.
IMO, const modifier is not required. Gives more freedom to user of the function without requiring cast. In tdelibs and many other places, TQString is used.
IMO, const modifier is not required. Gives more freedom to user of the function without requiring cast. In tdelibs and many other places, TQString is used.
I believe that two situations have been addressed here:
Targeted cleaning of the original memory to ensure that the password is not left forgotten in memory.
Shorten the previous length of the string => moreover, there was intentional use of isNull instead of isEmpty. Here we could use truncate instead of the new TQString.
I believe that two situations have been addressed here:
1. Targeted cleaning of the original memory to ensure that the password is not left forgotten in memory.
2. Shorten the previous length of the string => moreover, there was intentional use of isNull instead of isEmpty. Here we could use truncate instead of the new TQString.
yeah, wipePassPhrase() is required, to be honest I missed that line. Anyhow I think we should use isEmpty() instead of isNull(). If aPass =="" it makes no sense to say that we have a password 😉
yeah, wipePassPhrase() is required, to be honest I missed that line. Anyhow I think we should use isEmpty() instead of isNull(). If aPass =="" it makes no sense to say that we have a password :wink:
I add another piece to the bug 2961 puzzle. I did not test the result. By the way, I did not find out if anyone else uses the
finished()
signal fromcertmanager/lib/ui/passphrasedialog.h
– whether changing the parameter may cause additional problems.IMO, const modifier is not required. Gives more freedom to user of the function without requiring cast.
In tdelibs and many other places, TQString is used.
IMO, const modifier is not required. Gives more freedom to user of the function without requiring cast.
In tdelibs and many other places, TQString is used.
const TQString&
Being an object, passphrase will be deallocated when it leaves its scope. There should be no need for explicitly replace it with an empty TQString.
As sidenote, freeMem logic may no longer be necessary, perhaps?
We are not using malloc any more in the body. So a simpler version of the function could be used, IMO.
To consider if "havePassPhrase" is still required.
"const TQString &passphrase" looks better 😉
should use isEmpty() instead of "isNull()". This will check for "" strings as well.
should use isEmpty() instead of “isNull()”. This will check for “” strings as well.
“const TQString &passphrase” looks better 😉
should use isEmpty() instead of “isNull()”. This will check for “” strings as well.
should use isEmpty() instead of “isNull()”. This will check for “” strings as well.
should use isEmpty() instead of “isNull()”. This will check for “” strings as well.
should use isEmpty() instead of “isNull()”. This will check for “” strings as well.
const TQString& = TQString::null) seems more appropriate
const TQString& = TQString::null) seems more appropriate
Here and in all other 14 changes in this file (till the end)
“const TQString &passphrase” looks better
Here and all similar changes till end of PR
“const TQString &passphrase” looks better
here and all following changes where isNull() is used:
should use isEmtpy() to check also for ""
IMO, const modifier is not required. Gives more freedom to user of the function without requiring cast. In tdelibs and many other places, TQString is used.
IMO, const modifier is not required. Gives more freedom to user of the function without requiring cast. In tdelibs and many other places, TQString is used.
see comments mixed in the diff view. Minor things anyway.
Yes, you are right – because we do not return the pointer to existing data, but the new TQString, const has no reason.
Very good note, thank you.
I believe that two situations have been addressed here:
As I mentioned above – I think wipePassPhrase is primarily security-oriented here to make sure that the previous memory contents is destroyed.
ah, you are right, I had not see this in the full context. My bad :-(
yeah, wipePassPhrase() is required, to be honest I missed that line. Anyhow I think we should use isEmpty() instead of isNull(). If aPass =="" it makes no sense to say that we have a password 😉
Comments have been incorporated along with several other changes in the same sense – see
6492b716b3
.Looks ready to merge 😄
6492b716b3
.