1
0
mirror of git://git.gnupg.org/gnupg.git synced 2025-04-17 15:44:34 +02:00

Add a DECRYPTION_INFO status.

* g10/status.h (STATUS_DECRYPTION_INFO): New.
* g10/status.c (get_status_string): Add new status string.
* g10/encr-data.c: Include status.h.
(decrypt_data): Print STATUS_DECRYPTION_INFO.
--
This is  backport of commit  5667e33.

DECRYPTION_INFO <mdc_method> <sym_algo>
   Print information about the symmetric encryption algorithm and
   the MDC method.  This will be emitted even if the decryption
   fails.
This commit is contained in:
Werner Koch 2012-01-13 16:20:53 +01:00
parent 1575678710
commit cfb193a1de
3 changed files with 29 additions and 17 deletions

View File

@ -30,7 +30,7 @@
#include "cipher.h" #include "cipher.h"
#include "options.h" #include "options.h"
#include "i18n.h" #include "i18n.h"
#include "status.h"
static int mdc_decode_filter( void *opaque, int control, IOBUF a, static int mdc_decode_filter( void *opaque, int control, IOBUF a,
byte *buf, size_t *ret_len); byte *buf, size_t *ret_len);
@ -91,6 +91,15 @@ decrypt_data( void *procctx, PKT_encrypted *ed, DEK *dek )
log_info(_("encrypted with unknown algorithm %d\n"), dek->algo ); log_info(_("encrypted with unknown algorithm %d\n"), dek->algo );
dek->algo_info_printed = 1; dek->algo_info_printed = 1;
} }
{
char buf[20];
snprintf (buf, sizeof buf, "%d %d", ed->mdc_method, dek->algo);
write_status_text (STATUS_DECRYPTION_INFO, buf);
}
if( (rc=check_cipher_algo(dek->algo)) ) if( (rc=check_cipher_algo(dek->algo)) )
goto leave; goto leave;
blocksize = cipher_get_blocksize(dek->algo); blocksize = cipher_get_blocksize(dek->algo);

View File

@ -165,6 +165,7 @@ get_status_string ( int no )
case STATUS_PKA_TRUST_GOOD : s = "PKA_TRUST_GOOD"; break; case STATUS_PKA_TRUST_GOOD : s = "PKA_TRUST_GOOD"; break;
case STATUS_BEGIN_SIGNING : s = "BEGIN_SIGNING"; break; case STATUS_BEGIN_SIGNING : s = "BEGIN_SIGNING"; break;
case STATUS_ERROR : s = "ERROR"; break; case STATUS_ERROR : s = "ERROR"; break;
case STATUS_DECRYPTION_INFO: s = "DECRYPTION_INFO"; break;
default: s = "?"; break; default: s = "?"; break;
} }
return s; return s;

View File

@ -120,6 +120,8 @@
#define STATUS_ERROR 85 #define STATUS_ERROR 85
#define STATUS_DECRYPTION_INFO 86
/*-- status.c --*/ /*-- status.c --*/
void set_status_fd ( int fd ); void set_status_fd ( int fd );