[Interest] QLineEdit - clearing the password from memory
Atlant Schmidt
aschmidt at dekaresearch.com
Wed Apr 4 12:41:23 CEST 2012
Marcus:
> I need to make sure that the password is not kept in memory when
> QLineEdit is destroyed. I tried to use QLineEdit::clear() or
> QLineEdit::setText() but the password string stays in memory. I
> basically want to zeroise the private member string that holds the
> text, I believe QLineEditPrivate::text is the one. How can I access
> this member without changing Qt sources?
Object-oriented programming gives and object-oriented
programming takes away. This is one of those cases
where it takes away. Unless you're willing to go to
hacky lengths to get around the C++ object system,
then by design, you *CAN'T* get to private members.
But what you're proposing would be a very nice, very
sensible feature for QLineEdit when it's running in
QLineEdit::Password or QLineEdit::PasswordEchoOnEdit
or even QLineEdit::NoEcho mode: securely clean up the
private data upon destruction. So why not modify the
sources and pass your change back to the community?
This sounds like a pretty simple change.
Atlant
-----Original Message-----
From: interest-bounces+aschmidt=dekaresearch.com at qt-project.org [mailto:interest-bounces+aschmidt=dekaresearch.com at qt-project.org] On Behalf Of Marcus Frenkel
Sent: Wednesday, April 04, 2012 06:24
To: interest at qt-project.org
Subject: [Interest] QLineEdit - clearing the password from memory
Hi
I need to make sure that the password is not kept in memory when
QLineEdit is destroyed. I tried to use QLineEdit::clear() or
QLineEdit::setText() but the password string stays in memory. I
basically want to zeroise the private member string that holds the
text, I believe QLineEditPrivate::text is the one. How can I access
this member without changing Qt sources?
The alternative is to catch key events and store the text in a string
I can control, but there is too much to implement considering the
usage of selection, delete, backspace, arrow keys etc.
Thank you!
Marcus
_______________________________________________
Interest mailing list
Interest at qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest
Click https://www.mailcontrol.com/sr/kQ3sPLSBBpHTndxI!oX7UskfEqpntbSQ0!ULkjA42BJDOL58S3ozPOHH0TD0f2tRVJQZBBFsBrXn2TMNdeX8VA== to report this email as spam.
This e-mail and the information, including any attachments, it contains are intended to be a confidential communication only to the person or entity to whom it is addressed and may contain information that is privileged. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please immediately notify the sender and destroy the original message.
Thank you.
Please consider the environment before printing this email.
More information about the Interest
mailing list