Compare commits

..

No commits in common. "1abe3c80d1189d7d9911ef04a719a9ed7bb41d7f" and "0d09278687aa321e9231532878bb1cf7e232036e" have entirely different histories.

7 changed files with 6 additions and 109 deletions

View File

@ -1,50 +0,0 @@
From 34c649b3601383cd11dbc76221747ec16fd68e1b Mon Sep 17 00:00:00 2001
From: Werner Koch <wk@gnupg.org>
Date: Tue, 14 Jun 2022 11:33:27 +0200
Subject: [PATCH] g10: Fix garbled status messages in NOTATION_DATA
* g10/cpr.c (write_status_text_and_buffer): Fix off-by-one
--
Depending on the escaping and line wrapping the computed remaining
buffer length could be wrong. Fixed by always using a break to
terminate the escape detection loop. Might have happened for all
status lines which may wrap.
GnuPG-bug-id: T6027
---
g10/cpr.c | 13 ++++---------
1 file changed, 4 insertions(+), 9 deletions(-)
diff --git a/g10/cpr.c b/g10/cpr.c
index 9bfdd3c34..fa8005d6f 100644
--- a/g10/cpr.c
+++ b/g10/cpr.c
@@ -372,20 +372,15 @@ write_status_text_and_buffer (int no, const char *string,
}
first = 0;
}
- for (esc=0, s=buffer, n=len; n && !esc; s++, n--)
+ for (esc=0, s=buffer, n=len; n; s++, n--)
{
if (*s == '%' || *(const byte*)s <= lower_limit
|| *(const byte*)s == 127 )
esc = 1;
if (wrap && ++count > wrap)
- {
- dowrap=1;
- break;
- }
- }
- if (esc)
- {
- s--; n++;
+ dowrap=1;
+ if (esc || dowrap)
+ break;
}
if (s != buffer)
es_fwrite (buffer, s-buffer, 1, statusfp);
--
2.27.0

View File

@ -1,34 +0,0 @@
From c300253181cfc591cbcae9251eda5296ed29591b Mon Sep 17 00:00:00 2001
From: Werner Koch <wk@gnupg.org>
Date: Fri, 7 Oct 2022 14:12:33 +0200
Subject: [PATCH] common: Protect against a theoretical integer overflow in
tlv.c
* common/tlv.c (parse_ber_header): Protect agains integer overflow.
--
Although there is no concrete case where we use the (nhdr + length),
it is better to protect against this already here.
---
common/tlv.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/common/tlv.c b/common/tlv.c
index abef83a37..9618d04cb 100644
--- a/common/tlv.c
+++ b/common/tlv.c
@@ -222,6 +222,11 @@ parse_ber_header (unsigned char const **buffer, size_t *size,
*r_length = len;
}
+ if (*r_length > *r_nhdr && (*r_nhdr + *r_length) < *r_length)
+ {
+ return gpg_err_make (default_errsource, GPG_ERR_EOVERFLOW);
+ }
+
/* Without this kludge some example certs can't be parsed. */
if (*r_class == CLASS_UNIVERSAL && !*r_tag)
*r_length = 0;
--
2.27.0

BIN
gnupg-2.2.27.tar.bz2 Normal file

Binary file not shown.

BIN
gnupg-2.2.27.tar.bz2.sig Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,6 +1,6 @@
Name: gnupg2
Version: 2.2.32
Release: 5
Version: 2.2.27
Release: 4
Summary: Utility for secure communication and data storage
License: GPLv3+
@ -20,20 +20,16 @@ Patch8: gnupg-2.2.18-tests-add-test-cases-for-import-without-uid.patch
Patch9: gnupg-2.2.20-file-is-digest.patch
Patch10: gnupg-2.2.21-coverity.patch
Patch11: common-Avoid-undefined-behavior-of-left-shift-operat.patch
Patch12: backport-CVE-2022-34903.patch
Patch13: backport-common-Protect-against-a-theoretical-integer-overflow.patch
BuildRequires: gcc
BuildRequires: zlib-devel, npth-devel, texinfo
BuildRequires: libgpg-error-devel >= 1.41
BuildRequires: libgcrypt-devel >= 1.9.4
BuildRequires: libgpg-error-devel >= 1.31
BuildRequires: libgcrypt-devel >= 1.7.0
BuildRequires: libksba-devel >= 1.3.0
BuildRequires: libassuan-devel >= 2.1.0
# for TLS support
BuildRequires: gnutls-devel
Requires: libgcrypt >= 1.9.4
Requires: libgpg-error >= 1.41
Requires: libgcrypt >= 1.7.0
Requires: libgpg-error >= 1.31
Recommends: pinentry
Recommends: gnupg2-smime
@ -119,21 +115,6 @@ make check
%changelog
* Wed Jun 14 2023 yixiangzhike <yixiangzhike007@163.com> - 2.2.32-5
- backport upstream patch
* Wed Apr 19 2023 yixiangzhike <yixiangzhike007@163.com> - 2.2.32-4
- add BuildRequires:gnutls-devel to support TLS
* Mon Aug 15 2022 yixiangzhike <yixiangzhike007@163.com> - 2.2.32-3
- fix CVE-2022-34903
* Mon Jun 27 2022 yixiangzhike <yixiangzhike007@163.com> - 2.2.32-2
- need require new version libgpg-error(1.41) and libgcrypt(1.9.4)
* Fri Dec 10 2021 yixiangzhike <yixiangzhike007@163.com> - 2.2.32-1
- update to 2.2.32
* Mon Aug 2 2021 yixiangzhike <zhangxingliang3@huawei.com> - 2.2.27-4
- fix the insttools patch