aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Shaw <[email protected]>2003-11-06 05:12:20 +0000
committerDavid Shaw <[email protected]>2003-11-06 05:12:20 +0000
commit96f429eceeb3daf08b30080c5c2329fd27d5c1fd (patch)
treea5cc8e1d5dac80378c6447416e2c35312228e93e
parent* pkclist.c (build_pk_list): Show all recipients rather than showing each (diff)
downloadgnupg-96f429eceeb3daf08b30080c5c2329fd27d5c1fd.tar.gz
gnupg-96f429eceeb3daf08b30080c5c2329fd27d5c1fd.zip
* mainproc.c (proc_symkey_enc): Don't show algorithm information when
--quiet is set. Suggested by Duncan Harris. Also don't fail with BUG() when processing a --symmetric message with a cipher we don't have. * pkclist.c (build_pk_list): Revert last change. There are too many side effects for stable.
-rw-r--r--g10/ChangeLog10
-rw-r--r--g10/mainproc.c19
-rw-r--r--g10/pkclist.c53
3 files changed, 43 insertions, 39 deletions
diff --git a/g10/ChangeLog b/g10/ChangeLog
index c45fcfbe3..c624d82ad 100644
--- a/g10/ChangeLog
+++ b/g10/ChangeLog
@@ -1,3 +1,13 @@
+2003-11-05 David Shaw <[email protected]>
+
+ * mainproc.c (proc_symkey_enc): Don't show algorithm information
+ when --quiet is set. Suggested by Duncan Harris. Also don't fail
+ with BUG() when processing a --symmetric message with a cipher we
+ don't have.
+
+ * pkclist.c (build_pk_list): Revert last change. There are too
+ many side effects for stable.
+
2003-10-31 David Shaw <[email protected]>
* pkclist.c (build_pk_list): Show all recipients rather than
diff --git a/g10/mainproc.c b/g10/mainproc.c
index f0d2db1fa..1c70c2939 100644
--- a/g10/mainproc.c
+++ b/g10/mainproc.c
@@ -292,19 +292,22 @@ proc_symkey_enc( CTX c, PACKET *pkt )
int algo = enc->cipher_algo;
const char *s = cipher_algo_to_string (algo);
- if( s )
+ if(s)
{
- if(enc->seskeylen)
- log_info(_("%s encrypted session key\n"), s );
- else
- log_info(_("%s encrypted data\n"), s );
+ if(!opt.quiet)
+ {
+ if(enc->seskeylen)
+ log_info(_("%s encrypted session key\n"), s );
+ else
+ log_info(_("%s encrypted data\n"), s );
+ }
}
else
- log_info(_("encrypted with unknown algorithm %d\n"), algo );
+ log_error(_("encrypted with unknown algorithm %d\n"), algo );
c->last_was_session_key = 2;
- if ( opt.list_only )
- goto leave;
+ if(!s || opt.list_only)
+ goto leave;
c->dek = passphrase_to_dek( NULL, 0, algo, &enc->s2k, 0, NULL, NULL );
if(c->dek)
{
diff --git a/g10/pkclist.c b/g10/pkclist.c
index 1c6f8f87b..878695da7 100644
--- a/g10/pkclist.c
+++ b/g10/pkclist.c
@@ -857,41 +857,12 @@ build_pk_list( STRLIST rcpts, PK_LIST *ret_pk_list, unsigned use )
else if(backlog) {
answer=pop_strlist(&backlog);
}
- else
- {
- PK_LIST iter;
-
- tty_printf("\n");
- tty_printf(_("Current recipients:\n"));
- for(iter=pk_list;iter;iter=iter->next)
- {
- u32 keyid[2];
-
- keyid_from_pk(iter->pk,keyid);
- tty_printf("%4u%c/%08lX %s \"",
- nbits_from_pk(iter->pk),
- pubkey_letter(iter->pk->pubkey_algo),
- (ulong)keyid[1],
- datestr_from_pk(iter->pk));
-
- if(iter->pk->user_id)
- tty_print_utf8_string(iter->pk->user_id->name,
- iter->pk->user_id->len);
- else
- {
- size_t n;
- char *p = get_user_id( keyid, &n );
- tty_print_utf8_string( p, n );
- m_free(p);
- }
- tty_printf("\"\n");
- }
-
+ else {
answer = cpr_get_utf8("pklist.user_id.enter",
_("\nEnter the user ID. End with an empty line: "));
trim_spaces(answer);
cpr_kill_prompt();
- }
+ }
if( !answer || !*answer ) {
m_free(answer);
break;
@@ -938,6 +909,26 @@ build_pk_list( STRLIST rcpts, PK_LIST *ret_pk_list, unsigned use )
}
else {
PK_LIST r;
+ u32 keyid[2];
+
+ keyid_from_pk( pk, keyid);
+ tty_printf("Added %4u%c/%08lX %s \"",
+ nbits_from_pk( pk ),
+ pubkey_letter( pk->pubkey_algo ),
+ (ulong)keyid[1],
+ datestr_from_pk( pk ) );
+ if(pk->user_id)
+ tty_print_utf8_string(pk->user_id->name,
+ pk->user_id->len);
+ else
+ {
+ size_t n;
+ char *p = get_user_id( keyid, &n );
+ tty_print_utf8_string( p, n );
+ m_free(p);
+ }
+ tty_printf("\"\n");
+
r = m_alloc( sizeof *r );
r->pk = pk; pk = NULL;
r->next = pk_list;