summaryrefslogtreecommitdiffstats
path: root/g10/passphrase.c
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>1999-04-08 09:41:35 +0200
committerWerner Koch <wk@gnupg.org>1999-04-08 09:41:35 +0200
commit97efca04ef9d1e3971f2858bc31f2e8d7a60b05b (patch)
tree094b3b289b32d275862f5e16397b588f80472256 /g10/passphrase.c
parentSee ChangeLog: Wed Apr 7 20:51:39 CEST 1999 Werner Koch (diff)
downloadgnupg2-97efca04ef9d1e3971f2858bc31f2e8d7a60b05b.tar.xz
gnupg2-97efca04ef9d1e3971f2858bc31f2e8d7a60b05b.zip
See ChangeLog: Thu Apr 8 09:35:53 CEST 1999 Werner Koch
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 ) {