gpg: Print warning when rejecting weak digests
[gnupg.git] / g10 / sig-check.c
index 84930d6..23f42b9 100644 (file)
@@ -282,10 +282,16 @@ do_check( PKT_public_key *pk, PKT_signature *sig, gcry_md_hd_t digest,
     if (!opt.flags.allow_weak_digest_algos)
       {
         if (sig->digest_algo == GCRY_MD_MD5)
-          return GPG_ERR_DIGEST_ALGO;
+          {
+            print_digest_rejected_note(sig->digest_algo);
+            return GPG_ERR_DIGEST_ALGO;
+          }
         for (weak = opt.additional_weak_digests; weak; weak = weak->next)
           if (sig->digest_algo == weak->algo)
-            return GPG_ERR_DIGEST_ALGO;
+            {
+              print_digest_rejected_note(sig->digest_algo);
+              return GPG_ERR_DIGEST_ALGO;
+            }
       }
 
     /* Make sure the digest algo is enabled (in case of a detached