Fix file-is-digest patch (#2022904)
This commit is contained in:
parent
be4744249b
commit
921e417e4f
@ -64,16 +64,33 @@ diff -up gnupg-2.2.20/g10/sign.c.file-is-digest gnupg-2.2.20/g10/sign.c
|
||||
else
|
||||
sig->version = 4; /* Required. */
|
||||
|
||||
@@ -860,8 +863,11 @@ write_signature_packets (ctrl_t ctrl,
|
||||
err = mk_sig_subpkt_key_block (ctrl, sig, pk);
|
||||
else
|
||||
err = 0;
|
||||
@@ -860,14 +863,22 @@ write_signature_packets (ctrl_t ctrl,
|
||||
if (gcry_md_copy (&md, hash))
|
||||
BUG ();
|
||||
|
||||
- build_sig_subpkt_from_sig (sig, pk);
|
||||
- mk_notation_policy_etc (ctrl, sig, NULL, pk);
|
||||
- if (opt.flags.include_key_block && IS_SIG (sig))
|
||||
- err = mk_sig_subpkt_key_block (ctrl, sig, pk);
|
||||
- else
|
||||
- err = 0;
|
||||
- hash_sigversion_to_magic (md, sig, extrahash);
|
||||
- gcry_md_final (md);
|
||||
+ if (!opt.file_is_digest)
|
||||
+ {
|
||||
+ build_sig_subpkt_from_sig (sig, pk);
|
||||
+ mk_notation_policy_etc (ctrl, sig, NULL, pk);
|
||||
+ if (opt.flags.include_key_block && IS_SIG (sig))
|
||||
+ err = mk_sig_subpkt_key_block (ctrl, sig, pk);
|
||||
+ else
|
||||
+ err = 0;
|
||||
+
|
||||
+ if (!opt.file_is_digest) {
|
||||
+ hash_sigversion_to_magic (md, sig, extrahash);
|
||||
+ gcry_md_final (md);
|
||||
+ }
|
||||
+ else if (sig->version >= 4)
|
||||
+ {
|
||||
+ log_bug("file-is-digest doesn't work with v4 sigs\n");
|
||||
+ }
|
||||
|
||||
if (!err)
|
||||
|
Loading…
Reference in New Issue
Block a user