aboutsummaryrefslogtreecommitdiffstats
path: root/g10/sig-check.c
diff options
context:
space:
mode:
Diffstat (limited to 'g10/sig-check.c')
-rw-r--r--g10/sig-check.c25
1 files changed, 12 insertions, 13 deletions
diff --git a/g10/sig-check.c b/g10/sig-check.c
index 94f0cc5ff..6bac63034 100644
--- a/g10/sig-check.c
+++ b/g10/sig-check.c
@@ -239,26 +239,25 @@ do_check( PKT_public_key *pk, PKT_signature *sig, MD_HANDLE digest,
{
MPI result = NULL;
int rc=0;
+ struct weakhash *weak;
if( (rc=do_check_messages(pk,sig,r_expired,r_revoked)) )
return rc;
- if (sig->digest_algo == DIGEST_ALGO_MD5
- && !opt.flags.allow_weak_digest_algos)
- {
- static int shown;
-
- if (!shown)
+ if (!opt.flags.allow_weak_digest_algos)
+ for (weak = opt.weak_digests; weak; weak = weak->next)
+ if (sig->digest_algo == weak->algo)
{
- log_info
- (_("Note: signatures using the %s algorithm are rejected\n"),
- "MD5");
- shown = 1;
+ if (!weak->rejection_shown)
+ {
+ log_info
+ (_("Note: signatures using the %s algorithm are rejected\n"),
+ digest_algo_to_string(sig->digest_algo));
+ weak->rejection_shown = 1;
+ }
+ return G10ERR_DIGEST_ALGO;
}
- return G10ERR_DIGEST_ALGO;
- }
-
/* make sure the digest algo is enabled (in case of a detached signature)*/
md_enable( digest, sig->digest_algo );