summaryrefslogtreecommitdiffstats
path: root/g10/passphrase.c
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>1998-05-29 13:53:54 +0200
committerWerner Koch <wk@gnupg.org>1998-05-29 13:53:54 +0200
commite284277f0490a4606b99f3de5fdc3053084b99dd (patch)
treef9a5e6a69e82a5efe339ccdaa09664fa0679b066 /g10/passphrase.c
parentadd-key works (diff)
downloadgnupg2-85b15ba0fe2b6eaf86cb83cd152a246c8fcf5f2f.tar.xz
gnupg2-85b15ba0fe2b6eaf86cb83cd152a246c8fcf5f2f.zip
*** empty log message ***V0-2-19
Diffstat (limited to 'g10/passphrase.c')
-rw-r--r--g10/passphrase.c28
1 files changed, 20 insertions, 8 deletions
diff --git a/g10/passphrase.c b/g10/passphrase.c
index ebcba9942..8005ffd9f 100644
--- a/g10/passphrase.c
+++ b/g10/passphrase.c
@@ -31,6 +31,7 @@
#include "cipher.h"
#include "keydb.h"
#include "main.h"
+#include "i18n.h"
static int pwfd = -1;
static char *next_pw = NULL;
@@ -108,14 +109,25 @@ passphrase_to_dek( u32 *keyid, int cipher_algo, STRING2KEY *s2k, int mode )
}
if( keyid && !opt.batch && !next_pw ) {
- char *ustr;
- tty_printf("Need a pass phrase to unlock the secret key for:\n");
- tty_printf(" \"" );
- ustr = get_user_id_string( keyid );
- tty_print_string( ustr, strlen(ustr) );
- m_free(ustr);
- tty_printf("\"\n\n");
-
+ PKT_public_cert *pkc = m_alloc_clear( sizeof *pkc );
+ size_t n;
+ char *p;
+
+ tty_printf(_("\nYou need a passphrase to unlock the secret key for\n"
+ "user: \"") );
+ p = get_user_id( keyid, &n );
+ tty_print_string( p, n );
+ m_free(p);
+ tty_printf("\"\n");
+
+ if( !get_pubkey( pkc, keyid ) ) {
+ const char *s = pubkey_algo_to_string( pkc->pubkey_algo );
+ tty_printf( _("(%u-bit %s key, ID %08lX, created %s)\n"),
+ nbits_from_pkc( pkc ), s?s:"?", (ulong)keyid[1],
+ strtimestamp(pkc->timestamp) );
+ }
+ tty_printf("\n");
+ free_public_cert( pkc );
}
if( next_pw ) {
pw = next_pw;