summaryrefslogtreecommitdiffstats
path: root/g10/sign.c
diff options
context:
space:
mode:
authorNIIBE Yutaka <gniibe@fsij.org>2022-03-19 05:38:37 +0100
committerNIIBE Yutaka <gniibe@fsij.org>2022-03-19 05:38:37 +0100
commit0ba69e5581914f23f7efdd4d38b890f6def8967a (patch)
treefae4287309a398ba569ea62436a5dcfc0cd0dc54 /g10/sign.c
parentgpg: Print info about the used AEAD algorithm in the compliance msg. (diff)
downloadgnupg2-0ba69e5581914f23f7efdd4d38b890f6def8967a.tar.xz
gnupg2-0ba69e5581914f23f7efdd4d38b890f6def8967a.zip
gpg: Always use version >= 4 to generate signature.
* g10/sign.c (update_keysig_packet): Make sure sig->version >= 4. -- GnuPG-bug-id: 5809 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
Diffstat (limited to '')
-rw-r--r--g10/sign.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/g10/sign.c b/g10/sign.c
index 2ab76c99b..385254987 100644
--- a/g10/sign.c
+++ b/g10/sign.c
@@ -1928,6 +1928,15 @@ update_keysig_packet (ctrl_t ctrl,
/* Create a new signature packet. */
sig = copy_signature (NULL, orig_sig);
+ /* Don't generate version 3 signature, but newer. */
+ if (sig->version == 3)
+ {
+ if (pk->version > 3)
+ sig->version = pk->version;
+ else
+ sig->version = 4;
+ }
+
sig->digest_algo = digest_algo;
/* We need to create a new timestamp so that new sig expiration