1
0
mirror of git://git.gnupg.org/gnupg.git synced 2025-01-21 14:47:03 +01:00

gpg: Add a DECRYPTION_INFO status.

* common/status.h (STATUS_DECRYPTION_INFO): New.
* g10/encr-data.c: Include status.h.
(decrypt_data): Emit STATUS_DECRYPTION_INFO line.
--

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-31 15:14:20 +01:00
parent 66e93807a9
commit f772757ea1
3 changed files with 60 additions and 44 deletions

View File

@ -49,6 +49,7 @@ enum
STATUS_NO_PUBKEY, STATUS_NO_PUBKEY,
STATUS_NO_SECKEY, STATUS_NO_SECKEY,
STATUS_NEED_PASSPHRASE_SYM, STATUS_NEED_PASSPHRASE_SYM,
STATUS_DECRYPTION_INFO,
STATUS_DECRYPTION_FAILED, STATUS_DECRYPTION_FAILED,
STATUS_DECRYPTION_OKAY, STATUS_DECRYPTION_OKAY,
STATUS_MISSING_PASSPHRASE, STATUS_MISSING_PASSPHRASE,

View File

@ -695,6 +695,12 @@ more arguments in future versions.
may either be the specified mountpoint or one randomly choosen may either be the specified mountpoint or one randomly choosen
by g13. by g13.
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.
Format of the "--attribute-fd" output Format of the "--attribute-fd" output
===================================== =====================================

View File

@ -1,6 +1,6 @@
/* encr-data.c - process an encrypted data packet /* encr-data.c - process an encrypted data packet
* Copyright (C) 1998, 1999, 2000, 2001, 2005, * Copyright (C) 1998, 1999, 2000, 2001, 2005,
* 2006, 2009 Free Software Foundation, Inc. * 2006, 2009, 2012 Free Software Foundation, Inc.
* *
* This file is part of GnuPG. * This file is part of GnuPG.
* *
@ -30,6 +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,
@ -95,6 +96,14 @@ 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);
}
rc = openpgp_cipher_test_algo (dek->algo); rc = openpgp_cipher_test_algo (dek->algo);
if (rc) if (rc)
goto leave; goto leave;