mirror of
git://git.gnupg.org/gnupg.git
synced 2025-02-08 17:43:04 +01:00
gpg: Change --print-mds to output enabled OpenPGP algos.
* g10/gpg.c (print_mds): Use opengpg_md_test_algo. Test also for MD5 availibility.
This commit is contained in:
parent
aa76a16606
commit
54a11729fb
34
g10/gpg.c
34
g10/gpg.c
@ -4333,9 +4333,11 @@ print_mds( const char *fname, int algo )
|
|||||||
if( algo )
|
if( algo )
|
||||||
gcry_md_enable (md, algo);
|
gcry_md_enable (md, algo);
|
||||||
else {
|
else {
|
||||||
gcry_md_enable (md, GCRY_MD_MD5);
|
if (!openpgp_md_test_algo (GCRY_MD_MD5))
|
||||||
|
gcry_md_enable (md, GCRY_MD_MD5);
|
||||||
gcry_md_enable (md, GCRY_MD_SHA1);
|
gcry_md_enable (md, GCRY_MD_SHA1);
|
||||||
gcry_md_enable (md, GCRY_MD_RMD160);
|
if (!openpgp_md_test_algo (GCRY_MD_RMD160))
|
||||||
|
gcry_md_enable (md, GCRY_MD_RMD160);
|
||||||
if (!openpgp_md_test_algo (GCRY_MD_SHA224))
|
if (!openpgp_md_test_algo (GCRY_MD_SHA224))
|
||||||
gcry_md_enable (md, GCRY_MD_SHA224);
|
gcry_md_enable (md, GCRY_MD_SHA224);
|
||||||
if (!openpgp_md_test_algo (GCRY_MD_SHA256))
|
if (!openpgp_md_test_algo (GCRY_MD_SHA256))
|
||||||
@ -4356,35 +4358,37 @@ print_mds( const char *fname, int algo )
|
|||||||
if ( algo )
|
if ( algo )
|
||||||
print_hashline( md, algo, fname );
|
print_hashline( md, algo, fname );
|
||||||
else {
|
else {
|
||||||
print_hashline( md, GCRY_MD_MD5, fname );
|
if (!openpgp_md_test_algo (GCRY_MD_MD5))
|
||||||
|
print_hashline( md, GCRY_MD_MD5, fname );
|
||||||
print_hashline( md, GCRY_MD_SHA1, fname );
|
print_hashline( md, GCRY_MD_SHA1, fname );
|
||||||
if (!gcry_md_test_algo (GCRY_MD_RMD160))
|
if (!openpgp_md_test_algo (GCRY_MD_RMD160))
|
||||||
print_hashline( md, GCRY_MD_RMD160, fname );
|
print_hashline( md, GCRY_MD_RMD160, fname );
|
||||||
if (!gcry_md_test_algo (GCRY_MD_SHA224))
|
if (!openpgp_md_test_algo (GCRY_MD_SHA224))
|
||||||
print_hashline (md, GCRY_MD_SHA224, fname);
|
print_hashline (md, GCRY_MD_SHA224, fname);
|
||||||
if (!gcry_md_test_algo (GCRY_MD_SHA256))
|
if (!openpgp_md_test_algo (GCRY_MD_SHA256))
|
||||||
print_hashline( md, GCRY_MD_SHA256, fname );
|
print_hashline( md, GCRY_MD_SHA256, fname );
|
||||||
if (!gcry_md_test_algo (GCRY_MD_SHA384))
|
if (!openpgp_md_test_algo (GCRY_MD_SHA384))
|
||||||
print_hashline ( md, GCRY_MD_SHA384, fname );
|
print_hashline ( md, GCRY_MD_SHA384, fname );
|
||||||
if (!gcry_md_test_algo (GCRY_MD_SHA512))
|
if (!openpgp_md_test_algo (GCRY_MD_SHA512))
|
||||||
print_hashline ( md, GCRY_MD_SHA512, fname );
|
print_hashline ( md, GCRY_MD_SHA512, fname );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if( algo )
|
if( algo )
|
||||||
print_hex(md,-algo,fname);
|
print_hex(md,-algo,fname);
|
||||||
else {
|
else {
|
||||||
print_hex( md, GCRY_MD_MD5, fname );
|
if (!openpgp_md_test_algo (GCRY_MD_MD5))
|
||||||
|
print_hex( md, GCRY_MD_MD5, fname );
|
||||||
print_hex( md, GCRY_MD_SHA1, fname );
|
print_hex( md, GCRY_MD_SHA1, fname );
|
||||||
if (!gcry_md_test_algo (GCRY_MD_RMD160))
|
if (!openpgp_md_test_algo (GCRY_MD_RMD160))
|
||||||
print_hex( md, GCRY_MD_RMD160, fname );
|
print_hex( md, GCRY_MD_RMD160, fname );
|
||||||
if (!gcry_md_test_algo (GCRY_MD_SHA224))
|
if (!openpgp_md_test_algo (GCRY_MD_SHA224))
|
||||||
print_hex (md, GCRY_MD_SHA224, fname);
|
print_hex (md, GCRY_MD_SHA224, fname);
|
||||||
if (!gcry_md_test_algo (GCRY_MD_SHA256))
|
if (!openpgp_md_test_algo (GCRY_MD_SHA256))
|
||||||
print_hex( md, GCRY_MD_SHA256, fname );
|
print_hex( md, GCRY_MD_SHA256, fname );
|
||||||
if (!gcry_md_test_algo (GCRY_MD_SHA384))
|
if (!openpgp_md_test_algo (GCRY_MD_SHA384))
|
||||||
print_hex( md, GCRY_MD_SHA384, fname );
|
print_hex( md, GCRY_MD_SHA384, fname );
|
||||||
if (!gcry_md_test_algo (GCRY_MD_SHA512))
|
if (!openpgp_md_test_algo (GCRY_MD_SHA512))
|
||||||
print_hex( md, GCRY_MD_SHA512, fname );
|
print_hex( md, GCRY_MD_SHA512, fname );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user