aboutsummaryrefslogtreecommitdiffstats
path: root/g10
diff options
context:
space:
mode:
Diffstat (limited to 'g10')
-rw-r--r--g10/ChangeLog6
-rw-r--r--g10/passphrase.c13
2 files changed, 14 insertions, 5 deletions
diff --git a/g10/ChangeLog b/g10/ChangeLog
index 4c25e991a..c0227385c 100644
--- a/g10/ChangeLog
+++ b/g10/ChangeLog
@@ -1,3 +1,9 @@
+2003-03-05 David Shaw <[email protected]>
+
+ * passphrase.c (agent_get_passphrase): Fix memory leak with
+ symmetric messages. Fix segfault with symmetric messages. Fix
+ incorrect prompt with symmetric messages.
+
2003-03-04 David Shaw <[email protected]>
* options.skel: Add explantion and commented-out
diff --git a/g10/passphrase.c b/g10/passphrase.c
index fe7e9670a..e7dcd6d6e 100644
--- a/g10/passphrase.c
+++ b/g10/passphrase.c
@@ -614,9 +614,12 @@ agent_get_passphrase ( u32 *keyid, int mode, const char *tryagain_text )
memset (fpr, 0, MAX_FINGERPRINT_LEN );
if( keyid && get_pubkey( pk, keyid ) )
- pk = NULL; /* oops: no key for some reason */
+ {
+ free_public_key( pk );
+ pk = NULL; /* oops: no key for some reason */
+ }
- if ( !mode && pk )
+ if ( !mode && pk && keyid )
{
char *uid;
size_t uidlen;
@@ -658,10 +661,10 @@ agent_get_passphrase ( u32 *keyid, int mode, const char *tryagain_text )
}
}
- else if (mode == 1 )
- atext = m_strdup ( _("Enter passphrase\n") );
- else
+ else if (mode == 2 )
atext = m_strdup ( _("Repeat passphrase\n") );
+ else
+ atext = m_strdup ( _("Enter passphrase\n") );
if ( (fd = agent_open (&prot)) == -1 )
goto failure;