From 5d5b70ae0f515290a3d64daa1d687fe8c8477f76 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Thu, 9 Apr 2020 12:13:49 +0200 Subject: common: New function to map hash algo names. * common/sexputil.c (hash_algo_to_string): New. -- Libgcrypt expects lowercase names and it is cumbersome to downcase those retrieved via gcry_md_algo_name. It is easier and also faster to use a dedicated map function. --- common/util.h | 1 + 1 file changed, 1 insertion(+) (limited to 'common/util.h') diff --git a/common/util.h b/common/util.h index daf6d7438..d22a1bf60 100644 --- a/common/util.h +++ b/common/util.h @@ -202,6 +202,7 @@ int get_pk_algo_from_key (gcry_sexp_t key); int get_pk_algo_from_canon_sexp (const unsigned char *keydata, size_t keydatalen); char *pubkey_algo_string (gcry_sexp_t s_pkey, enum gcry_pk_algos *r_algoid); +const char *hash_algo_to_string (int algo); /*-- convert.c --*/ int hex2bin (const char *string, void *buffer, size_t length); -- cgit v1.2.3