aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJ0WI <J0WI@users.noreply.github.com>2022-07-05 15:27:13 +0000
committerpsykose <alice@ayaya.dev>2022-07-05 17:27:14 +0200
commite48277e247f5497854f848543e07eb264c75a194 (patch)
tree73af1d5d217105ef4bec7e410c1c44e0abbbb4cd
parent44d8db2c6ba38827fe4e0af58c35d9bb6d0ebc98 (diff)
main/gnupg: patch CVE-2022-34903
-rw-r--r--main/gnupg/APKBUILD6
-rw-r--r--main/gnupg/CVE-2022-34903.patch41
2 files changed, 46 insertions, 1 deletions
diff --git a/main/gnupg/APKBUILD b/main/gnupg/APKBUILD
index 0e411a239c1..c061d436b82 100644
--- a/main/gnupg/APKBUILD
+++ b/main/gnupg/APKBUILD
@@ -4,7 +4,7 @@
pkgname=gnupg
pkgver=2.2.31
_ver=${pkgver/_beta/-beta}
-pkgrel=1
+pkgrel=2
pkgdesc="GNU Privacy Guard 2 - meta package for full GnuPG suite"
url="https://www.gnupg.org/"
arch="all"
@@ -52,6 +52,7 @@ subpackages="
$pkgname-utils
"
source="https://gnupg.org/ftp/gcrypt/gnupg/gnupg-$_ver.tar.bz2
+ CVE-2022-34903.patch
0001-Include-sys-select.h-for-FD_SETSIZE.patch
0010-avoid-beta-warning.patch
0020-avoid-regenerating-defsincdate-use-shipped-file.patch
@@ -70,6 +71,8 @@ source="https://gnupg.org/ftp/gcrypt/gnupg/gnupg-$_ver.tar.bz2
"
# secfixes:
+# 2.2.31-r2:
+# - CVE-2022-34903
# 2.2.23-r0:
# - CVE-2020-25125
# 2.2.18-r0:
@@ -231,6 +234,7 @@ utils() {
sha512sums="
2f6fa200e08d6b8993b482e5825bea6083afc8686c4e1ae80386b36ae49e1c2d73066c508edaa359a7794cb26ba7a00f81555a906fa422d1117e41415cfa2fea gnupg-2.2.31.tar.bz2
+658d5ff636f9b45de7501895c299146633c30bc249f94664573ecf847779ea27be853244ceb2cc0e95c0c56253bbb6ccff509027b23f20f003aa018235211a4d CVE-2022-34903.patch
c6cc4595081c5b025913fa3ebecf0dff87a84f3c669e3fef106e4fa040f1d4314ee52dd4c0e0002b213034fb0810221cfdd0033eae5349b6e3978f05d08bcac7 0001-Include-sys-select.h-for-FD_SETSIZE.patch
0e2aef4ae5c43c43efe2c914534d73f8f7068b49b5826b1f999296c30395497c4af121e4e99152ff7b43dcf56d1792cd46aea5158ca48597d6e0fca6d7358711 0010-avoid-beta-warning.patch
18004e52925b1f03e67a29a3d43b39e8119cf3426cdad4136824b932ad906ac499b4ceb3d7573177a9f16410d3b80c8f0e4bcdc54dd284f3f803a2cef609ad01 0020-avoid-regenerating-defsincdate-use-shipped-file.patch
diff --git a/main/gnupg/CVE-2022-34903.patch b/main/gnupg/CVE-2022-34903.patch
new file mode 100644
index 00000000000..20bb9a23713
--- /dev/null
+++ b/main/gnupg/CVE-2022-34903.patch
@@ -0,0 +1,41 @@
+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
+
+diff --git a/g10/cpr.c b/g10/cpr.c
+index d502e8b52..bc4b715ed 100644
+--- a/g10/cpr.c
++++ b/g10/cpr.c
+@@ -328,20 +328,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);