diff options
author | Werner Koch <wk@gnupg.org> | 2014-09-18 14:56:39 +0200 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2014-09-18 14:56:39 +0200 |
commit | 327134934d79d141d92170ad3b4a6ef3cb718ee0 (patch) | |
tree | 9b0a8775ad75c1797455962691913693b95494c4 | |
parent | gpg: Re-indent a function. (diff) | |
download | gnupg2-327134934d79d141d92170ad3b4a6ef3cb718ee0.tar.xz gnupg2-327134934d79d141d92170ad3b4a6ef3cb718ee0.zip |
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.
-rw-r--r-- | g10/gpg.c | 36 |
1 files changed, 18 insertions, 18 deletions
@@ -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 ); } } |