diff options
author | Werner Koch <[email protected]> | 2020-04-09 10:13:49 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2020-04-09 10:20:19 +0000 |
commit | 5d5b70ae0f515290a3d64daa1d687fe8c8477f76 (patch) | |
tree | aa378b37478aee2afc6d03ae3165d36fc44c4743 /common/util.h | |
parent | scd:p15: Return a display S/N via Assuan. (diff) | |
download | gnupg-5d5b70ae0f515290a3d64daa1d687fe8c8477f76.tar.gz gnupg-5d5b70ae0f515290a3d64daa1d687fe8c8477f76.zip |
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.
Diffstat (limited to 'common/util.h')
-rw-r--r-- | common/util.h | 1 |
1 files changed, 1 insertions, 0 deletions
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); |