Version in base suite: 2.4.7-21 Base version: gnupg2_2.4.7-21 Target version: gnupg2_2.4.7-21+deb13u1 Base file: /srv/ftp-master.debian.org/ftp/pool/main/g/gnupg2/gnupg2_2.4.7-21.dsc Target file: /srv/ftp-master.debian.org/policy/pool/main/g/gnupg2/gnupg2_2.4.7-21+deb13u1.dsc changelog | 17 + patches/from-master/gpg-Do-not-use-a-default-when-asking-for-another-out.patch | 83 +++++ patches/gpg-Avoid-potential-downgrade-to-SHA1-in-3rd-party-k.patch | 55 +++ patches/gpg-Error-out-on-unverified-output-for-non-detached-.patch | 148 ++++++++++ patches/gpg-Fix-possible-memory-corruption-in-the-armor-pars.patch | 125 ++++++++ patches/series | 4 6 files changed, 432 insertions(+) dpkg-source: warning: cannot verify inline signature for /srv/release.debian.org/tmp/tmp5b8nquq4/gnupg2_2.4.7-21.dsc: no acceptable signature found dpkg-source: warning: cannot verify inline signature for /srv/release.debian.org/tmp/tmp5b8nquq4/gnupg2_2.4.7-21+deb13u1.dsc: no acceptable signature found diff -Nru gnupg2-2.4.7/debian/changelog gnupg2-2.4.7/debian/changelog --- gnupg2-2.4.7/debian/changelog 2025-06-01 04:45:25.000000000 +0000 +++ gnupg2-2.4.7/debian/changelog 2026-01-01 05:46:01.000000000 +0000 @@ -1,3 +1,20 @@ +gnupg2 (2.4.7-21+deb13u1) trixie; urgency=high + + * Avoid potential downgrade to SHA1 in 3rd party key signatures. + https://gpg.fail/sha1 #12 + Patch from STABLE-BRANCH-2-4 + * gpg: Error out on unverified output for non-detached signatures. + https://gpg.fail/detached #1 + Patch from STABLE-BRANCH-2-4 + * gpg: Fix possible memory corruption in the armor parser (CVE-2025-68973) + https://gpg.fail/memcpy #5 + Patch from STABLE-BRANCH-2-4 (Closes: #1124221) + * gpg: Do not use a default when asking for another output filename. + https://gpg.fail/filename #2 + Unfuzzed patch from GIT master + + -- Andreas Metzler Thu, 01 Jan 2026 06:46:01 +0100 + gnupg2 (2.4.7-21) unstable; urgency=medium * update Dutch po file (Closes: #1104540) diff -Nru gnupg2-2.4.7/debian/patches/from-master/gpg-Do-not-use-a-default-when-asking-for-another-out.patch gnupg2-2.4.7/debian/patches/from-master/gpg-Do-not-use-a-default-when-asking-for-another-out.patch --- gnupg2-2.4.7/debian/patches/from-master/gpg-Do-not-use-a-default-when-asking-for-another-out.patch 1970-01-01 00:00:00.000000000 +0000 +++ gnupg2-2.4.7/debian/patches/from-master/gpg-Do-not-use-a-default-when-asking-for-another-out.patch 2026-01-01 05:43:10.000000000 +0000 @@ -0,0 +1,83 @@ +From ad0c6c33c3d6fe7ff7cc8c2e73d02ead5788e5b3 Mon Sep 17 00:00:00 2001 +From: Werner Koch +Date: Mon, 27 Oct 2025 12:43:27 +0100 +Subject: [PATCH] gpg: Do not use a default when asking for another output + filename. +Bug: https://dev.gnupg.org/T7908 + +* g10/options.h (COMPAT_SUGGEST_EMBEDDED_NAME): New. +* g10/gpg.c (compatibility_flags): New flags "suggest-embedded-name". +* g10/openfile.c (ask_outfile_name): Do not show a default unless the +compatibiliy flag is used. +--- + g10/gpg.c | 1 + + g10/openfile.c | 12 +++++++++--- + g10/options.h | 5 +++++ + 3 files changed, 15 insertions(+), 3 deletions(-) + +--- a/g10/gpg.c ++++ b/g10/gpg.c +@@ -1035,10 +1035,11 @@ static struct debug_flags_s debug_flags + + + /* The list of compatibility flags. */ + static struct compatibility_flags_s compatibility_flags [] = + { ++ { COMPAT_SUGGEST_EMBEDDED_NAME, "suggest-embedded-name" }, + { 0, NULL } + }; + + + #ifdef ENABLE_SELINUX_HACKS +--- a/g10/openfile.c ++++ b/g10/openfile.c +@@ -123,23 +123,29 @@ make_outfile_name (const char *iname) + NULL if no file has been given or if it is not possible to ask the + user. NAME is the template len which might contain enbedded Nuls. + NAMELEN is its actual length. + */ + char * +-ask_outfile_name( const char *name, size_t namelen ) ++ask_outfile_name (const char *name, size_t namelen) + { + size_t n; + const char *s; + char *prompt; + char *fname; + char *defname; + + if ( opt.batch ) + return NULL; + +- defname = name && namelen? make_printable_string (name, namelen, 0) : NULL; +- ++ /* To avoid tricking the user into using the embedded filename we do ++ * not anymore include that name in the prompt as default. For ++ * modern v5 signature this might make sense as they are now covered ++ * by the signature but we better leave such a decision to a GUI. */ ++ if (name && namelen && (opt.compat_flags & COMPAT_SUGGEST_EMBEDDED_NAME)) ++ defname = make_printable_string (name, namelen, 0); ++ else ++ defname = NULL; + s = _("Enter new filename"); + n = strlen(s) + (defname?strlen (defname):0) + 10; + prompt = xmalloc (n); + if (defname) + snprintf (prompt, n, "%s [%s]: ", s, defname ); +--- a/g10/options.h ++++ b/g10/options.h +@@ -386,11 +386,13 @@ struct { + EXTERN_UNLESS_MAIN_MODULE int memory_debug_mode; + EXTERN_UNLESS_MAIN_MODULE int memory_stat_debug_mode; + + /* Compatibility flags */ + /* #define COMPAT_FOO 1 */ +- ++#define COMPAT_SUGGEST_EMBEDDED_NAME 16 /* Show the non-signed ++ * embedded filename as ++ * suggestion. */ + + /* Compliance test macors. */ + #define GNUPG (opt.compliance==CO_GNUPG || opt.compliance==CO_DE_VS) + #define OPENPGP (opt.compliance==CO_OPENPGP) + #define RFC2440 (opt.compliance==CO_RFC2440) diff -Nru gnupg2-2.4.7/debian/patches/gpg-Avoid-potential-downgrade-to-SHA1-in-3rd-party-k.patch gnupg2-2.4.7/debian/patches/gpg-Avoid-potential-downgrade-to-SHA1-in-3rd-party-k.patch --- gnupg2-2.4.7/debian/patches/gpg-Avoid-potential-downgrade-to-SHA1-in-3rd-party-k.patch 1970-01-01 00:00:00.000000000 +0000 +++ gnupg2-2.4.7/debian/patches/gpg-Avoid-potential-downgrade-to-SHA1-in-3rd-party-k.patch 2026-01-01 05:43:10.000000000 +0000 @@ -0,0 +1,55 @@ +From ddb012be7fe2ab0eb713b33c50c22ac8f194fa6c Mon Sep 17 00:00:00 2001 +From: Werner Koch +Date: Wed, 22 Oct 2025 11:19:55 +0200 +Subject: [PATCH 1/3] gpg: Avoid potential downgrade to SHA1 in 3rd party key + signatures. +Bug: https://dev.gnupg.org/T7904 + +* g10/sig-check.c (check_signature_over_key_or_uid): Always initialize +IS_SELFSIG because it is later used to detect SHA1 non-selfsignatures. +-- + +The value of is_selfsig was also used to decide whether to reject a a +SHA_signature if it is not a self-signature. However, a code path +exists where is_selfsig was set to stub_is_selfsig and not initilaized +in this case. + +Fixes-commit: c4f2d9e3e1d77d2f1f168764fcdfed32f7d1dfc4 +Reported-by: 8b79fe4dd0581c1cd000e1fbecba9f39e16a396a +--- + g10/sig-check.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/g10/sig-check.c b/g10/sig-check.c +index ed83c23f9..17de90184 100644 +--- a/g10/sig-check.c ++++ b/g10/sig-check.c +@@ -888,11 +888,11 @@ check_key_signature (ctrl_t ctrl, kbnode_t root, kbnode_t node, + * this signature can't be over PACKET. Returns GPG_ERR_NOT_FOUND if + * the key that generated the signature (according to SIG) could not + * be found. Returns GPG_ERR_BAD_SIGNATURE if the signature is bad. + * Other errors codes may be returned if something else goes wrong. + * +- * IF IS_SELFSIG is not NULL, sets *IS_SELFSIG to 1 if this is a ++ * If IS_SELFSIG is not NULL, sets *IS_SELFSIG to 1 if this is a + * self-signature (by the key's primary key) or 0 if not. + * + * If RET_PK is not NULL, returns a copy of the public key that + * generated the signature (i.e., the signer) on success. This must + * be released by the caller using release_public_key_parts (). */ +@@ -908,10 +908,12 @@ check_signature_over_key_or_uid (ctrl_t ctrl, PKT_public_key *signer, + int stub_is_selfsig; + + if (!is_selfsig) + is_selfsig = &stub_is_selfsig; + ++ *is_selfsig = 0; /* Init early to comply with function description. */ ++ + rc = openpgp_pk_test_algo (sig->pubkey_algo); + if (rc) + return rc; + rc = openpgp_md_test_algo (sig->digest_algo); + if (rc) +-- +2.51.0 + diff -Nru gnupg2-2.4.7/debian/patches/gpg-Error-out-on-unverified-output-for-non-detached-.patch gnupg2-2.4.7/debian/patches/gpg-Error-out-on-unverified-output-for-non-detached-.patch --- gnupg2-2.4.7/debian/patches/gpg-Error-out-on-unverified-output-for-non-detached-.patch 1970-01-01 00:00:00.000000000 +0000 +++ gnupg2-2.4.7/debian/patches/gpg-Error-out-on-unverified-output-for-non-detached-.patch 2026-01-01 05:43:10.000000000 +0000 @@ -0,0 +1,148 @@ +From 9d302f978bd718a7b477294c2f5b386bea6ca00d Mon Sep 17 00:00:00 2001 +From: Werner Koch +Date: Wed, 22 Oct 2025 12:39:15 +0200 +Subject: [PATCH 2/3] gpg: Error out on unverified output for non-detached + signatures. +Bug: https://dev.gnupg.org/T7903 + +* g10/mainproc.c (do_proc_packets): Never reset the any.data flag. +-- + +Fixes-commit: 3b1b6f9d98b38480ba2074158fa640b881cdb97e +Updates-commit: 69384568f66a48eff3968bb1714aa13925580e9f +Reported-by: 8b79fe4dd0581c1cd000e1fbecba9f39e16a396a + +When using + + gpg --verify -o - msg.sig msg + +even with the --batch option the outout written to stdout or the file +five to -o may not be what has been verified. For example given a +file "msg" with this content: + +--8<---------------cut here---------------start------------->8--- +It is a wise father that knows his own child. + -- William Shakespeare, "The Merchant of Venice" +--8<---------------cut here---------------end--------------->8--- + +and a manipulated "msg.sig" (named "msg-mod.sig") the output could be + + $ gpg --verify -o - --batch msg-mod.sig msg + The last thing one knows in constructing a work is what to put first. + -- Blaise Pascal + gpg: Signature made Wed 22 Oct 2025 11:51:52 AM CEST + gpg: using EDDSA key A7F91C6EB9395B25B4A9BAD25B9[...] + gpg: Good signature from "alice@example.org" [ultimate] + +The plaintext shown is ot what has been verified (i.e. the first +quote) and may lead the user top wrong conclusions. + +But note: Using the output of the verify command for detached +signatures is useless because with a non-manipulated signature nothing +would haven been written. + +How to replicate the whole thing: + +1. Import this public key: +-----BEGIN PGP PUBLIC KEY BLOCK----- + +mDMEaPio6RYJKwYBBAHaRw8BAQdAt0yaE+e5CG9iLdEJnZqTv3QUj2/eoMuQR55/ +y4tbGr20EWFsaWNlQGV4YW1wbGUub3JniLUEExYKAF0WIQSn+RxuuTlbJbSputJb +mJ0rJeN/3AUCaPio6RsUgAAAAAAEAA5tYW51MiwyLjUrMS4xMSwyLDICGwMFCQWj +moAFCwkIBwICIgIGFQoJCAsCBBYCAwECHgcCF4AACgkQW5idKyXjf9x2WwD7BQrA +0p7XnalGu83R+Kx7UvMvPnwwBb/P2CMlHlU5+TMBAICnsrHa/pFClAE3pA2io0rF ++9M55DF3gkYTkpIWf1YBuDgEaPio6RIKKwYBBAGXVQEFAQEHQHEcigLeQJiXMMui +LDCFO9EVFQqt5wDu5fhyt8haLpVbAwEIB4iUBBgWCgA8FiEEp/kcbrk5WyW0qbrS +W5idKyXjf9wFAmj4qOkbFIAAAAAABAAObWFudTIsMi41KzEuMTEsMiwyAhsMAAoJ +EFuYnSsl43/czvIBANaamGqOQgF02ykNkP62wj/1iYuXn5bXHXRtmV7htjQiAQCO +HZYHTrVSBoyYfT40zVFSFtydnlLAlFisZNuydwPPDw== +=GjvX +-----END PGP PUBLIC KEY BLOCK----- + +2. Unpack the first quote below and put it into the file "msg" +-----BEGIN PGP ARMORED FILE----- +Comment: Use "gpg --dearmor" for unpacking + +SXQgaXMgYSB3aXNlIGZhdGhlciB0aGF0IGtub3dzIGhpcyBvd24gY2hpbGQuCgkJ +LS0gV2lsbGlhbSBTaGFrZXNwZWFyZSwgIlRoZSBNZXJjaGFudCBvZiBWZW5pY2Ui +Cg== +=0fUy +-----END PGP ARMORED FILE----- + +3. Unpack the original signature into the file "msg.sig" +-----BEGIN PGP ARMORED FILE----- + +iJEEABYKADkWIQSn+RxuuTlbJbSputJbmJ0rJeN/3AUCaPipOBsUgAAAAAAEAA5t +YW51MiwyLjUrMS4xMSwyLDIACgkQW5idKyXjf9w6UwD/fS6X9bs36WXVN5BSANIA +bhtHb8X4jZu4NFKk/ZSwUtIBANMdYO6F1kUMyFNZVZa4Yk12UmcClF9mXLBVlfeH +RFkL +=wCLE +-----END PGP ARMORED FILE----- + +4. Unpack the modified signature into the file "msg-mod.sig" +-----BEGIN PGP ARMORED FILE----- + +kA0DAAoWW5idKyXjf9wBy19iAGj4qrhUaGUgbGFzdCB0aGluZyBvbmUga25vd3Mg +aW4gY29uc3RydWN0aW5nIGEgd29yayBpcyB3aGF0IHRvIHB1dCBmaXJzdC4KCQkt +LSBCbGFpc2UgUGFzY2FsCoiRBAAWCgA5FiEEp/kcbrk5WyW0qbrSW5idKyXjf9wF +Amj4qTgbFIAAAAAABAAObWFudTIsMi41KzEuMTEsMiwyAAoJEFuYnSsl43/cOlMA +/30ul/W7N+ll1TeQUgDSAG4bR2/F+I2buDRSpP2UsFLSAQDTHWDuhdZFDMhTWVWW +uGJNdlJnApRfZlywVZX3h0RZC8r/AAAAA1BHUA== +=DafU +-----END PGP ARMORED FILE----- + +Now run + gpg --verify -o - msg.sig msg + gpg --verify -o - msg-mod.sig msg + +after this pacth is applied the second command will output an error +message "gpg: not a detached signature" + +The modification was to prepend a one-pass signature packet for alices +signature and a a literal data packet with the second quote to the +original signature and also append a marker packet or something other. +gpgsplit is the tool of choice here. Thus the packet composition of +msg-mod.sig is: + + :onepass_sig packet: keyid 5B989D2B25E37FDC + version 3, sigclass 0x00, digest 10, pubkey 22, last=1 + :literal data packet: + mode b (62), created 1761127096, name="", + raw data: 89 bytes + :signature packet: algo 22, keyid 5B989D2B25E37FDC + version 4, created 1761126712, md5len 0, sigclass 0x00 + [...] + :marker packet: PGP + +Kudos to the reporter for the detailed report. +--- + g10/mainproc.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/g10/mainproc.c b/g10/mainproc.c +index 308738839..82ea79d46 100644 +--- a/g10/mainproc.c ++++ b/g10/mainproc.c +@@ -1756,14 +1756,18 @@ do_proc_packets (CTX c, iobuf_t a) + * I used it. Adding the MDC check here is a hack. + * The right solution is to initiate another context for encrypted + * packet and not to reuse the current one ... It works right + * when there is a compression packet between which adds just + * an extra layer. ++ * ++ * Note that we should not reset the any.data due to another ++ * packets. Just set it once on seeing a plaintext. ++ * + * Hmmm: Rewrite this whole module here?? + */ + if (pkt->pkttype != PKT_SIGNATURE && pkt->pkttype != PKT_MDC) +- c->any.data = (pkt->pkttype == PKT_PLAINTEXT); ++ c->any.data |= (pkt->pkttype == PKT_PLAINTEXT); + + if (newpkt == -1) + ; + else if (newpkt) + { +-- +2.51.0 + diff -Nru gnupg2-2.4.7/debian/patches/gpg-Fix-possible-memory-corruption-in-the-armor-pars.patch gnupg2-2.4.7/debian/patches/gpg-Fix-possible-memory-corruption-in-the-armor-pars.patch --- gnupg2-2.4.7/debian/patches/gpg-Fix-possible-memory-corruption-in-the-armor-pars.patch 1970-01-01 00:00:00.000000000 +0000 +++ gnupg2-2.4.7/debian/patches/gpg-Fix-possible-memory-corruption-in-the-armor-pars.patch 2026-01-01 05:43:10.000000000 +0000 @@ -0,0 +1,125 @@ +From 4ecc5122f20e10c17172ed72f4fa46c784b5fb48 Mon Sep 17 00:00:00 2001 +From: Werner Koch +Date: Thu, 23 Oct 2025 11:36:04 +0200 +Subject: [PATCH 4/4] gpg: Fix possible memory corruption in the armor parser. +Origin: https://dev.gnupg.org/rG4ecc5122f20e10c17172ed72f4fa46c784b5fb48 +Bug-Debian: https://bugs.debian.org/1124221 +Bug-Debian-Security: https://security-tracker.debian.org/tracker/CVE-2025-68973 +Bug: https://dev.gnupg.org/T7906 + +* g10/armor.c (armor_filter): Fix faulty double increment. + +* common/iobuf.c (underflow_target): Assert that the filter +implementations behave well. +-- + +This fixes a bug in a code path which can only be reached with special +crafted input data and would then error out at an upper layer due to +corrupt input (every second byte in the buffer is unitialized +garbage). No fuzzing has yet hit this case and we don't have a test +case for this code path. However memory corruption can never be +tolerated as it always has the protential for remode code execution. + +Reported-by: 8b79fe4dd0581c1cd000e1fbecba9f39e16a396a +Fixes-commit: c27c7416d5148865a513e007fb6f0a34993a6073 +which fixed +Fixes-commit: 7d0efec7cf5ae110c99511abc32587ff0c45b14f +Backported-from-master: 115d138ba599328005c5321c0ef9f00355838ca9 + +The bug was introduced on 1999-01-07 by me: +* armor.c: Rewrote large parts. +which I fixed on 1999-03-02 but missed to fix the other case: +* armor.c (armor_filter): Fixed armor bypassing. + +Below is base64+gzipped test data which can be used with valgrind to +show access to uninitalized memory in write(2) in the unpatched code. + +--8<---------------cut here---------------start------------->8--- +H4sICIDd+WgCA3h4AO3QMQ6CQBCG0djOKbY3G05gscYFSRAJt/AExp6Di0cQG0ze +a//MV0zOq3Pt+jFN3ZTKfLvP9ZLafqifJUe8juOjeZbVtSkbRPmRgICAgICAgICA +gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA +gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA +gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA +gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA +gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA +gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA +gICAgICAgICAgICAgICAgICAgICAgICAgMCXF6dYDgAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAC7E14AAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADwZ94aieId3+8EAA== +--8<---------------cut here---------------end--------------->8--- +--- + common/iobuf.c | 8 +++++++- + g10/armor.c | 4 ++-- + 2 files changed, 9 insertions(+), 3 deletions(-) + +diff --git a/common/iobuf.c b/common/iobuf.c +index 748e6935d..2497713c1 100644 +--- a/common/iobuf.c ++++ b/common/iobuf.c +@@ -2041,10 +2041,12 @@ underflow_target (iobuf_t a, int clear_pending_eof, size_t target) + /* There is no space for more data. Don't bother calling + A->FILTER. */ + rc = 0; + else + { ++ size_t tmplen; ++ + /* If no buffered data and drain buffer has been setup, and drain + * buffer is largish, read data directly to drain buffer. */ + if (a->d.len == 0 + && a->e_d.buf + && a->e_d.len >= IOBUF_ZEROCOPY_THRESHOLD_SIZE) +@@ -2053,23 +2055,27 @@ underflow_target (iobuf_t a, int clear_pending_eof, size_t target) + + if (DBG_IOBUF) + log_debug ("iobuf-%d.%d: underflow: A->FILTER (%lu bytes, to external drain)\n", + a->no, a->subno, (ulong)len); + +- rc = a->filter (a->filter_ov, IOBUFCTRL_UNDERFLOW, a->chain, ++ tmplen = len; /* Used to check for bugs in the filter. */ ++ rc = a->filter (a->filter_ov, IOBUFCTRL_UNDERFLOW, a->chain, + a->e_d.buf, &len); ++ log_assert (len <= tmplen); + a->e_d.used = len; + len = 0; + } + else + { + if (DBG_IOBUF) + log_debug ("iobuf-%d.%d: underflow: A->FILTER (%lu bytes)\n", + a->no, a->subno, (ulong)len); + ++ tmplen = len; /* Used to check for bugs in the filter. */ + rc = a->filter (a->filter_ov, IOBUFCTRL_UNDERFLOW, a->chain, + &a->d.buf[a->d.len], &len); ++ log_assert (len <= tmplen); + } + } + a->d.len += len; + + if (DBG_IOBUF) +diff --git a/g10/armor.c b/g10/armor.c +index 81af15339..f8cfa86db 100644 +--- a/g10/armor.c ++++ b/g10/armor.c +@@ -1300,12 +1300,12 @@ armor_filter( void *opaque, int control, + log_debug("armor-filter: control: %d\n", control ); + if( control == IOBUFCTRL_UNDERFLOW && afx->inp_bypass ) { + n = 0; + if( afx->buffer_len ) { + /* Copy the data from AFX->BUFFER to BUF. */ +- for(; n < size && afx->buffer_pos < afx->buffer_len; n++ ) +- buf[n++] = afx->buffer[afx->buffer_pos++]; ++ for(; n < size && afx->buffer_pos < afx->buffer_len;) ++ buf[n++] = afx->buffer[afx->buffer_pos++]; + if( afx->buffer_pos >= afx->buffer_len ) + afx->buffer_len = 0; + } + /* If there is still space in BUF, read directly into it. */ + for(; n < size; n++ ) { +-- +2.51.0 + diff -Nru gnupg2-2.4.7/debian/patches/series gnupg2-2.4.7/debian/patches/series --- gnupg2-2.4.7/debian/patches/series 2025-05-31 13:24:25.000000000 +0000 +++ gnupg2-2.4.7/debian/patches/series 2026-01-01 05:43:10.000000000 +0000 @@ -55,3 +55,7 @@ from-upstream/gpg-Fix-another-regression-due-to-the-T7547-fix.patch from-upstream/0009-common-Fix-logic-for-certain-recsel-conditions.patch nl.po.update.diff +gpg-Avoid-potential-downgrade-to-SHA1-in-3rd-party-k.patch +gpg-Error-out-on-unverified-output-for-non-detached-.patch +gpg-Fix-possible-memory-corruption-in-the-armor-pars.patch +from-master/gpg-Do-not-use-a-default-when-asking-for-another-out.patch