From 327134934d79d141d92170ad3b4a6ef3cb718ee0 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Thu, 18 Sep 2014 14:56:39 +0200 Subject: gpg: Replace a hash algo test function. * g10/gpg.c (print_mds): Replace openpgp_md_test_algo. -- This is actually not required because as of now the used OpenPGP and Gcrypt hash algorithm numbers are identical. But that might change in the future. This changes the behavior of GnuPG in case it has been build with some algorithms disabled: If those algorithms are available in Libgcrypt, their results will be used printed anyway. --- g10/gpg.c | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/g10/gpg.c b/g10/gpg.c index b06e392f7..a9d248dec 100644 --- a/g10/gpg.c +++ b/g10/gpg.c @@ -4386,18 +4386,18 @@ print_mds( const char *fname, int algo ) gcry_md_enable (md, algo); else { - if (!openpgp_md_test_algo (GCRY_MD_MD5)) + if (!gcry_md_test_algo (GCRY_MD_MD5)) gcry_md_enable (md, GCRY_MD_MD5); gcry_md_enable (md, GCRY_MD_SHA1); - if (!openpgp_md_test_algo (GCRY_MD_RMD160)) + if (!gcry_md_test_algo (GCRY_MD_RMD160)) gcry_md_enable (md, GCRY_MD_RMD160); - if (!openpgp_md_test_algo (GCRY_MD_SHA224)) + if (!gcry_md_test_algo (GCRY_MD_SHA224)) gcry_md_enable (md, GCRY_MD_SHA224); - if (!openpgp_md_test_algo (GCRY_MD_SHA256)) + if (!gcry_md_test_algo (GCRY_MD_SHA256)) gcry_md_enable (md, GCRY_MD_SHA256); - if (!openpgp_md_test_algo (GCRY_MD_SHA384)) + if (!gcry_md_test_algo (GCRY_MD_SHA384)) gcry_md_enable (md, GCRY_MD_SHA384); - if (!openpgp_md_test_algo (GCRY_MD_SHA512)) + if (!gcry_md_test_algo (GCRY_MD_SHA512)) gcry_md_enable (md, GCRY_MD_SHA512); } @@ -4415,18 +4415,18 @@ print_mds( const char *fname, int algo ) print_hashline (md, algo, fname); else { - if (!openpgp_md_test_algo (GCRY_MD_MD5)) + if (!gcry_md_test_algo (GCRY_MD_MD5)) print_hashline( md, GCRY_MD_MD5, fname ); print_hashline( md, GCRY_MD_SHA1, fname ); - if (!openpgp_md_test_algo (GCRY_MD_RMD160)) + if (!gcry_md_test_algo (GCRY_MD_RMD160)) print_hashline( md, GCRY_MD_RMD160, fname ); - if (!openpgp_md_test_algo (GCRY_MD_SHA224)) + if (!gcry_md_test_algo (GCRY_MD_SHA224)) print_hashline (md, GCRY_MD_SHA224, fname); - if (!openpgp_md_test_algo (GCRY_MD_SHA256)) + if (!gcry_md_test_algo (GCRY_MD_SHA256)) print_hashline( md, GCRY_MD_SHA256, fname ); - if (!openpgp_md_test_algo (GCRY_MD_SHA384)) + if (!gcry_md_test_algo (GCRY_MD_SHA384)) print_hashline ( md, GCRY_MD_SHA384, fname ); - if (!openpgp_md_test_algo (GCRY_MD_SHA512)) + if (!gcry_md_test_algo (GCRY_MD_SHA512)) print_hashline ( md, GCRY_MD_SHA512, fname ); } } @@ -4436,18 +4436,18 @@ print_mds( const char *fname, int algo ) print_hex (md, -algo, fname); else { - if (!openpgp_md_test_algo (GCRY_MD_MD5)) + if (!gcry_md_test_algo (GCRY_MD_MD5)) print_hex (md, GCRY_MD_MD5, fname); print_hex (md, GCRY_MD_SHA1, fname ); - if (!openpgp_md_test_algo (GCRY_MD_RMD160)) + if (!gcry_md_test_algo (GCRY_MD_RMD160)) print_hex (md, GCRY_MD_RMD160, fname ); - if (!openpgp_md_test_algo (GCRY_MD_SHA224)) + if (!gcry_md_test_algo (GCRY_MD_SHA224)) print_hex (md, GCRY_MD_SHA224, fname); - if (!openpgp_md_test_algo (GCRY_MD_SHA256)) + if (!gcry_md_test_algo (GCRY_MD_SHA256)) print_hex (md, GCRY_MD_SHA256, fname ); - if (!openpgp_md_test_algo (GCRY_MD_SHA384)) + if (!gcry_md_test_algo (GCRY_MD_SHA384)) print_hex (md, GCRY_MD_SHA384, fname ); - if (!openpgp_md_test_algo (GCRY_MD_SHA512)) + if (!gcry_md_test_algo (GCRY_MD_SHA512)) print_hex (md, GCRY_MD_SHA512, fname ); } } -- cgit v1.2.3