Allocate passphrase on demand.
Don't store passphrase as char* member variable. This would crash the application when exporting private keys. See https://dev.gnupg.org/T5151#139421
This commit is contained in:
@@ -48,7 +48,13 @@ public:
|
||||
const string GetPassphrase();
|
||||
|
||||
private:
|
||||
char * m_passphrase;
|
||||
/*
|
||||
* Don't use char* m_passphrase. It is manipulated by gpg and exporting
|
||||
* secret keys become messy, to the point of crashing the application if
|
||||
* passphrase is bad.
|
||||
* See https://dev.gnupg.org/T5151#139421
|
||||
*/
|
||||
string m_passphrase;
|
||||
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user