diff options
Diffstat (limited to 'meta/recipes-devtools/rpm/files/0002-CVE-2021-3521.patch')
-rw-r--r-- | meta/recipes-devtools/rpm/files/0002-CVE-2021-3521.patch | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/meta/recipes-devtools/rpm/files/0002-CVE-2021-3521.patch b/meta/recipes-devtools/rpm/files/0002-CVE-2021-3521.patch new file mode 100644 index 0000000000..a8ff98fa26 --- /dev/null +++ b/meta/recipes-devtools/rpm/files/0002-CVE-2021-3521.patch | |||
@@ -0,0 +1,62 @@ | |||
1 | From c4b1bee51bbdd732b94b431a951481af99117703 Mon Sep 17 00:00:00 2001 | ||
2 | From: Panu Matilainen <pmatilai@redhat.com> | ||
3 | Date: Thu, 30 Sep 2021 09:51:10 +0300 | ||
4 | Subject: [PATCH 2/3] Process MPI's from all kinds of signatures | ||
5 | |||
6 | No immediate effect but needed by the following commits. | ||
7 | |||
8 | CVE: CVE-2021-3521 | ||
9 | Upstream-Status: Backport[https://github.com/rpm-software-management/rpm/commit/b5e8bc74b] | ||
10 | |||
11 | Signed-off-by: Changqing Li <changqing.li@windriver.com> | ||
12 | --- | ||
13 | rpmio/rpmpgp.c | 12 +++++------- | ||
14 | 1 file changed, 5 insertions(+), 7 deletions(-) | ||
15 | |||
16 | diff --git a/rpmio/rpmpgp.c b/rpmio/rpmpgp.c | ||
17 | index e472b5320f..57d411d1e0 100644 | ||
18 | --- a/rpmio/rpmpgp.c | ||
19 | +++ b/rpmio/rpmpgp.c | ||
20 | @@ -515,7 +515,7 @@ pgpDigAlg pgpDigAlgFree(pgpDigAlg alg) | ||
21 | return NULL; | ||
22 | } | ||
23 | |||
24 | -static int pgpPrtSigParams(pgpTag tag, uint8_t pubkey_algo, uint8_t sigtype, | ||
25 | +static int pgpPrtSigParams(pgpTag tag, uint8_t pubkey_algo, | ||
26 | const uint8_t *p, const uint8_t *h, size_t hlen, | ||
27 | pgpDigParams sigp) | ||
28 | { | ||
29 | @@ -528,10 +528,8 @@ static int pgpPrtSigParams(pgpTag tag, uint8_t pubkey_algo, uint8_t sigtype, | ||
30 | int mpil = pgpMpiLen(p); | ||
31 | if (p + mpil > pend) | ||
32 | break; | ||
33 | - if (sigtype == PGPSIGTYPE_BINARY || sigtype == PGPSIGTYPE_TEXT) { | ||
34 | - if (sigalg->setmpi(sigalg, i, p)) | ||
35 | - break; | ||
36 | - } | ||
37 | + if (sigalg->setmpi(sigalg, i, p)) | ||
38 | + break; | ||
39 | p += mpil; | ||
40 | } | ||
41 | |||
42 | @@ -604,7 +602,7 @@ static int pgpPrtSig(pgpTag tag, const uint8_t *h, size_t hlen, | ||
43 | } | ||
44 | |||
45 | p = ((uint8_t *)v) + sizeof(*v); | ||
46 | - rc = pgpPrtSigParams(tag, v->pubkey_algo, v->sigtype, p, h, hlen, _digp); | ||
47 | + rc = pgpPrtSigParams(tag, v->pubkey_algo, p, h, hlen, _digp); | ||
48 | } break; | ||
49 | case 4: | ||
50 | { pgpPktSigV4 v = (pgpPktSigV4)h; | ||
51 | @@ -662,7 +660,7 @@ static int pgpPrtSig(pgpTag tag, const uint8_t *h, size_t hlen, | ||
52 | if (p > (h + hlen)) | ||
53 | return 1; | ||
54 | |||
55 | - rc = pgpPrtSigParams(tag, v->pubkey_algo, v->sigtype, p, h, hlen, _digp); | ||
56 | + rc = pgpPrtSigParams(tag, v->pubkey_algo, p, h, hlen, _digp); | ||
57 | } break; | ||
58 | default: | ||
59 | rpmlog(RPMLOG_WARNING, _("Unsupported version of key: V%d\n"), version); | ||
60 | -- | ||
61 | 2.17.1 | ||
62 | |||