diff options
Diffstat (limited to 'meta/recipes-devtools/rpm/files/CVE-2021-3521-01.patch')
-rw-r--r-- | meta/recipes-devtools/rpm/files/CVE-2021-3521-01.patch | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/meta/recipes-devtools/rpm/files/CVE-2021-3521-01.patch b/meta/recipes-devtools/rpm/files/CVE-2021-3521-01.patch new file mode 100644 index 0000000000..0882d6f310 --- /dev/null +++ b/meta/recipes-devtools/rpm/files/CVE-2021-3521-01.patch | |||
@@ -0,0 +1,60 @@ | |||
1 | From b5e8bc74b2b05aa557f663fe227b94d2bc64fbd8 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] Process MPI's from all kinds of signatures | ||
5 | |||
6 | No immediate effect but needed by the following commits. | ||
7 | |||
8 | Dependent patch: | ||
9 | CVE: CVE-2021-3521 | ||
10 | Upstream-Status: Backport [https://github.com/rpm-software-management/rpm/commit/b5e8bc74b2b05aa557f663fe227b94d2bc64fbd8] | ||
11 | Signed-off-by: Riyaz Khan <Riyaz.Khan@kpit.com> | ||
12 | |||
13 | --- | ||
14 | rpmio/rpmpgp.c | 12 +++++------- | ||
15 | 1 file changed, 5 insertions(+), 7 deletions(-) | ||
16 | |||
17 | diff --git a/rpmio/rpmpgp.c b/rpmio/rpmpgp.c | ||
18 | index ee5c81e246..340de5fc9a 100644 | ||
19 | --- a/rpmio/rpmpgp.c | ||
20 | +++ b/rpmio/rpmpgp.c | ||
21 | @@ -511,7 +511,7 @@ pgpDigAlg pgpDigAlgFree(pgpDigAlg alg) | ||
22 | return NULL; | ||
23 | } | ||
24 | |||
25 | -static int pgpPrtSigParams(pgpTag tag, uint8_t pubkey_algo, uint8_t sigtype, | ||
26 | +static int pgpPrtSigParams(pgpTag tag, uint8_t pubkey_algo, | ||
27 | const uint8_t *p, const uint8_t *h, size_t hlen, | ||
28 | pgpDigParams sigp) | ||
29 | { | ||
30 | @@ -524,10 +524,8 @@ static int pgpPrtSigParams(pgpTag tag, uint8_t pubkey_algo, uint8_t sigtype, | ||
31 | int mpil = pgpMpiLen(p); | ||
32 | if (p + mpil > pend) | ||
33 | break; | ||
34 | - if (sigtype == PGPSIGTYPE_BINARY || sigtype == PGPSIGTYPE_TEXT) { | ||
35 | - if (sigalg->setmpi(sigalg, i, p)) | ||
36 | - break; | ||
37 | - } | ||
38 | + if (sigalg->setmpi(sigalg, i, p)) | ||
39 | + break; | ||
40 | p += mpil; | ||
41 | } | ||
42 | |||
43 | @@ -600,7 +598,7 @@ static int pgpPrtSig(pgpTag tag, const uint8_t *h, size_t hlen, | ||
44 | } | ||
45 | |||
46 | p = ((uint8_t *)v) + sizeof(*v); | ||
47 | - rc = pgpPrtSigParams(tag, v->pubkey_algo, v->sigtype, p, h, hlen, _digp); | ||
48 | + rc = pgpPrtSigParams(tag, v->pubkey_algo, p, h, hlen, _digp); | ||
49 | } break; | ||
50 | case 4: | ||
51 | { pgpPktSigV4 v = (pgpPktSigV4)h; | ||
52 | @@ -658,7 +656,7 @@ static int pgpPrtSig(pgpTag tag, const uint8_t *h, size_t hlen, | ||
53 | if (p > (h + hlen)) | ||
54 | return 1; | ||
55 | |||
56 | - rc = pgpPrtSigParams(tag, v->pubkey_algo, v->sigtype, p, h, hlen, _digp); | ||
57 | + rc = pgpPrtSigParams(tag, v->pubkey_algo, p, h, hlen, _digp); | ||
58 | } break; | ||
59 | default: | ||
60 | rpmlog(RPMLOG_WARNING, _("Unsupported version of key: V%d\n"), version); | ||