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:
SET
2020-11-25 21:29:27 +01:00
parent 127cb7d738
commit de7880ae36
2 changed files with 14 additions and 5 deletions

View File

@@ -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;
};