diff options
author | David Shaw <[email protected]> | 2005-08-05 19:54:06 +0000 |
---|---|---|
committer | David Shaw <[email protected]> | 2005-08-05 19:54:06 +0000 |
commit | 82bee9c68a1529249aabb61b881c96c6e06d5a4a (patch) | |
tree | 49e1f299a71ab89269c9c992ddb567cae6aa4ca8 /g10/passphrase.c | |
parent | * ldap.m4: If a PATH is given to --with-ldap, bias directory (diff) | |
download | gnupg-82bee9c68a1529249aabb61b881c96c6e06d5a4a.tar.gz gnupg-82bee9c68a1529249aabb61b881c96c6e06d5a4a.zip |
* g10.c (main), passphrase.c (set_passphrase_from_string): New
--passphrase command line option. Only useful in very special
circumstances.
Diffstat (limited to 'g10/passphrase.c')
-rw-r--r-- | g10/passphrase.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/g10/passphrase.c b/g10/passphrase.c index 5f9c7915b..fa10eccec 100644 --- a/g10/passphrase.c +++ b/g10/passphrase.c @@ -115,6 +115,19 @@ get_last_passphrase() return p; } +/* Here's an interesting question: since this passphrase was passed in + on the command line, is there really any point in using secure + memory for it? I'm going with 'yes', since it doesn't hurt, and + might help in some small way (swapping). */ + +void +set_passphrase_from_string(const char *pass) +{ + xfree( fd_passwd ); + fd_passwd = xmalloc_secure(strlen(pass)+1); + strcpy(fd_passwd,pass); +} + void read_passphrase_from_fd( int fd ) |