56 lines
1.8 KiB
Diff
56 lines
1.8 KiB
Diff
From 7b399fcb8f52566e6f3b4327197a85facd08db91 Mon Sep 17 00:00:00 2001
|
|
From: Panu Matilainen <pmatilai@redhat.com>
|
|
Date: Thu, 30 Sep 2021 09:51:10 +0300
|
|
Subject: [PATCH] Process MPI's from all kinds of signatures
|
|
---
|
|
rpmio/rpmpgp.c | 12 +++++-------
|
|
1 file changed, 5 insertions(+), 7 deletions(-)
|
|
|
|
diff --git a/rpmio/rpmpgp.c b/rpmio/rpmpgp.c
|
|
index 33bef0b..b353fe6 100644
|
|
--- a/rpmio/rpmpgp.c
|
|
+++ b/rpmio/rpmpgp.c
|
|
@@ -511,7 +511,7 @@ pgpDigAlg pgpDigAlgFree(pgpDigAlg alg)
|
|
return NULL;
|
|
}
|
|
|
|
-static int pgpPrtSigParams(pgpTag tag, uint8_t pubkey_algo, uint8_t sigtype,
|
|
+static int pgpPrtSigParams(pgpTag tag, uint8_t pubkey_algo,
|
|
const uint8_t *p, const uint8_t *h, size_t hlen,
|
|
pgpDigParams sigp)
|
|
{
|
|
@@ -524,10 +524,8 @@ static int pgpPrtSigParams(pgpTag tag, uint8_t pubkey_algo, uint8_t sigtype,
|
|
int mpil = pgpMpiLen(p);
|
|
if (pend - p < mpil)
|
|
break;
|
|
- if (sigtype == PGPSIGTYPE_BINARY || sigtype == PGPSIGTYPE_TEXT) {
|
|
- if (sigalg->setmpi(sigalg, i, p))
|
|
- break;
|
|
- }
|
|
+ if (sigalg->setmpi(sigalg, i, p))
|
|
+ break;
|
|
p += mpil;
|
|
}
|
|
|
|
@@ -601,7 +599,7 @@ static int pgpPrtSig(pgpTag tag, const uint8_t *h, size_t hlen,
|
|
|
|
p = ((uint8_t *)v) + sizeof(*v);
|
|
_digp->data = p;
|
|
- rc = pgpPrtSigParams(tag, v->pubkey_algo, v->sigtype, p, h, hlen, _digp);
|
|
+ rc = pgpPrtSigParams(tag, v->pubkey_algo, p, h, hlen, _digp);
|
|
} break;
|
|
case 4:
|
|
{ pgpPktSigV4 v = (pgpPktSigV4)h;
|
|
@@ -660,7 +658,7 @@ static int pgpPrtSig(pgpTag tag, const uint8_t *h, size_t hlen,
|
|
return 1;
|
|
|
|
_digp->data = p;
|
|
- rc = pgpPrtSigParams(tag, v->pubkey_algo, v->sigtype, p, h, hlen, _digp);
|
|
+ rc = pgpPrtSigParams(tag, v->pubkey_algo, p, h, hlen, _digp);
|
|
} break;
|
|
default:
|
|
rpmlog(RPMLOG_WARNING, _("Unsupported version of key: V%d\n"), version);
|
|
--
|
|
2.27.0
|
|
|