aboutsummaryrefslogtreecommitdiffstats
path: root/common/sexputil.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2020-05-08 13:21:51 +0000
committerWerner Koch <[email protected]>2020-05-08 13:21:51 +0000
commit439c9b5cb55044f13d4af6563f4e791093d510b0 (patch)
treeb62ba3fc5b5151b89a53533483df4f573eb1b72c /common/sexputil.c
parentsm: Cleanup the use of GCRY_PK_ECC and GCRY_PK_ECDSA. (diff)
downloadgnupg-439c9b5cb55044f13d4af6563f4e791093d510b0.tar.gz
gnupg-439c9b5cb55044f13d4af6563f4e791093d510b0.zip
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 <[email protected]>
Diffstat (limited to 'common/sexputil.c')
-rw-r--r--common/sexputil.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/common/sexputil.c b/common/sexputil.c
index 66cd9f60e..7a67f2b7c 100644
--- a/common/sexputil.c
+++ b/common/sexputil.c
@@ -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 "[?]";
+ }
+}