summaryrefslogtreecommitdiffstats
path: root/g10/passphrase.c
diff options
context:
space:
mode:
Diffstat (limited to 'g10/passphrase.c')
-rw-r--r--g10/passphrase.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/g10/passphrase.c b/g10/passphrase.c
index 6da528015..3cc8e009d 100644
--- a/g10/passphrase.c
+++ b/g10/passphrase.c
@@ -133,14 +133,20 @@ passphrase_to_dek( u32 *keyid, int cipher_algo, STRING2KEY *s2k, int mode )
:DEFAULT_DIGEST_ALGO;
}
- if( keyid && !next_pw && is_status_enabled() ) {
+ if( !next_pw && is_status_enabled() ) {
char buf[50];
- sprintf( buf, "%08lX%08lX", (ulong)keyid[0], (ulong)keyid[1] );
- if( keyid[2] && keyid[3] && keyid[0] != keyid[2]
- && keyid[1] != keyid[3] )
- sprintf( buf+strlen(buf), " %08lX%08lX",
- (ulong)keyid[2], (ulong)keyid[3] );
- write_status_text( STATUS_NEED_PASSPHRASE, buf );
+ if( keyid ) {
+ sprintf( buf, "%08lX%08lX", (ulong)keyid[0], (ulong)keyid[1] );
+ if( keyid[2] && keyid[3] && keyid[0] != keyid[2]
+ && keyid[1] != keyid[3] )
+ sprintf( buf+strlen(buf), " %08lX%08lX",
+ (ulong)keyid[2], (ulong)keyid[3] );
+ write_status_text( STATUS_NEED_PASSPHRASE, buf );
+ }
+ else {
+ sprintf( buf, "%d %d %d", cipher_algo, s2k->mode, s2k->hash_algo );
+ write_status_text( STATUS_NEED_PASSPHRASE_SYM, buf );
+ }
}
if( keyid && !opt.batch && !next_pw ) {