mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
sm: Print algorithm infos in data decryption mode.
* common/sexputil.c (cipher_mode_to_string): New. * sm/decrypt.c (prepare_decryption): Show cipher algo and mode. (gpgsm_decrypt): Show key algo and fingerprint Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
parent
34b628db46
commit
439c9b5cb5
3 changed files with 30 additions and 0 deletions
|
@ -698,3 +698,19 @@ hash_algo_to_string (int algo)
|
|||
return hashnames[i].name;
|
||||
return "?";
|
||||
}
|
||||
|
||||
|
||||
/* Map cipher modes to a string. */
|
||||
const char *
|
||||
cipher_mode_to_string (int mode)
|
||||
{
|
||||
switch (mode)
|
||||
{
|
||||
case GCRY_CIPHER_MODE_CFB: return "CFB";
|
||||
case GCRY_CIPHER_MODE_CBC: return "CBC";
|
||||
case GCRY_CIPHER_MODE_GCM: return "GCM";
|
||||
case GCRY_CIPHER_MODE_OCB: return "OCB";
|
||||
case 14: return "EAX"; /* Only in gcrypt 1.9 */
|
||||
default: return "[?]";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -204,6 +204,7 @@ int get_pk_algo_from_canon_sexp (const unsigned char *keydata,
|
|||
char *pubkey_algo_string (gcry_sexp_t s_pkey, enum gcry_pk_algos *r_algoid);
|
||||
const char *pubkey_algo_to_string (int algo);
|
||||
const char *hash_algo_to_string (int algo);
|
||||
const char *cipher_mode_to_string (int mode);
|
||||
|
||||
/*-- convert.c --*/
|
||||
int hex2bin (const char *string, void *buffer, size_t length);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue