1
0
mirror of git://git.gnupg.org/gnupg.git synced 2025-03-28 22:49:59 +01:00

* mainproc.c (proc_symkey_enc, proc_encrypted): Keep a count of the number

of passphrases that can decrypt a symmetric or mixed symmetric/pk message
and include it in the list of keys shown to the user.
This commit is contained in:
David Shaw 2003-10-26 23:17:47 +00:00
parent ea4d713e88
commit ef0ade2d78
2 changed files with 17 additions and 3 deletions

View File

@ -1,3 +1,10 @@
2003-10-26 David Shaw <dshaw@jabberwocky.com>
* mainproc.c (proc_symkey_enc, proc_encrypted): Keep a count of
the number of passphrases that can decrypt a symmetric or mixed
symmetric/pk message and include it in the list of keys shown to
the user.
2003-10-25 David Shaw <dshaw@jabberwocky.com> 2003-10-25 David Shaw <dshaw@jabberwocky.com>
* mainproc.c (symkey_decrypt_sesskey): There is no way to tell the * mainproc.c (symkey_decrypt_sesskey): There is no way to tell the

View File

@ -50,7 +50,6 @@ struct kidlist_item {
}; };
/**************** /****************
* Structure to hold the context * Structure to hold the context
*/ */
@ -72,6 +71,7 @@ struct mainproc_context {
IOBUF iobuf; /* used to get the filename etc. */ IOBUF iobuf; /* used to get the filename etc. */
int trustletter; /* temp usage in list_node */ int trustletter; /* temp usage in list_node */
ulong local_id; /* ditto */ ulong local_id; /* ditto */
ulong symkeys;
struct kidlist_item *pkenc_list; /* list of encryption packets */ struct kidlist_item *pkenc_list; /* list of encryption packets */
struct { struct {
int op; int op;
@ -327,7 +327,9 @@ proc_symkey_enc( CTX c, PACKET *pkt )
c->dek->algo_info_printed = 1; c->dek->algo_info_printed = 1;
} }
} }
leave: leave:
c->symkeys++;
free_packet(pkt); free_packet(pkt);
} }
@ -477,10 +479,15 @@ proc_encrypted( CTX c, PACKET *pkt )
{ {
int result = 0; int result = 0;
if (!opt.quiet) { if (!opt.quiet)
{
if(c->symkeys>1)
log_info(_("encrypted with %lu passphrases\n"),c->symkeys);
else if(c->symkeys==1)
log_info(_("encrypted with 1 passphrase\n"));
print_pkenc_list ( c->pkenc_list, 1 ); print_pkenc_list ( c->pkenc_list, 1 );
print_pkenc_list ( c->pkenc_list, 0 ); print_pkenc_list ( c->pkenc_list, 0 );
} }
write_status( STATUS_BEGIN_DECRYPTION ); write_status( STATUS_BEGIN_DECRYPTION );