gpg: Fix extra check for sign usage of a data signature.
authorWerner Koch <wk@gnupg.org>
Mon, 8 Oct 2018 14:14:17 +0000 (16:14 +0200)
committerWerner Koch <wk@gnupg.org>
Mon, 8 Oct 2018 14:14:17 +0000 (16:14 +0200)
* g10/sig-check.c (check_signature_end_simple):
--

Obviously we should not ignore a back signature here.

Fixes-commit: 214b0077264e35c079e854a8b6374704aea45cd5
GnuPG-bug-id: 4014
Signed-off-by: Werner Koch <wk@gnupg.org>
g10/sig-check.c

index 0ec3843..9c32d4d 100644 (file)
@@ -480,7 +480,8 @@ check_signature_end_simple (PKT_public_key *pk, PKT_signature *sig,
     }
 
   /* For data signatures check that the key has sign usage.  */
-  if (IS_SIG (sig) && !(pk->pubkey_usage & PUBKEY_USAGE_SIG))
+  if (!IS_BACK_SIG (sig) && IS_SIG (sig)
+      && !(pk->pubkey_usage & PUBKEY_USAGE_SIG))
     {
       rc = gpg_error (GPG_ERR_WRONG_KEY_USAGE);
       if (!opt.quiet)