diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2017-03-28 10:53:34 +0300 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2017-03-28 10:53:34 +0300 |
commit | f30d96772e2954ec0ca3b2a81097ec98c2a50751 (patch) | |
tree | 98ebb31684ce2f004f3b49695d6d8881b5a53c28 | |
parent | 9dc0b6eb7334d461f3fc1756b75fc2395cd428d7 (diff) | |
download | rpm-f30d96772e2954ec0ca3b2a81097ec98c2a50751.tar.gz |
Parse signer keyid as part of siginfo struct parsing
Doesn't really change anything as such but seems saner this way
and also makes the keyid more readily available.
-rw-r--r-- | lib/package.c | 8 | ||||
-rw-r--r-- | lib/signature.c | 2 | ||||
-rw-r--r-- | lib/signature.h | 1 |
3 files changed, 4 insertions, 7 deletions
diff --git a/lib/package.c b/lib/package.c index 6beb203fd..78dbc0edd 100644 --- a/lib/package.c +++ b/lib/package.c @@ -15,7 +15,6 @@ #include "lib/rpmlead.h" #include "lib/signature.h" -#include "rpmio/digest.h" #include "rpmio/rpmio_internal.h" /* fd digest bits */ #include "lib/header_internal.h" /* XXX headerCheck */ @@ -92,11 +91,6 @@ static void headerMergeLegacySigs(Header h, Header sigh) headerFreeIterator(hi); } -static unsigned int getKeyid(pgpDigParams sigp) -{ - return (sigp != NULL) ? pgpGrab(sigp->signid+4, 4) : 0; -} - /** * Remember current key id. * XXX: This s*** needs to die. Hook it into keyring or sumthin... @@ -226,7 +220,7 @@ static rpmRC headerSigVerify(rpmKeyring keyring, rpmVSFlags vsflags, rc = rpmVerifySignature(keyring, &sigtd, sig, ctx, buf); if (keyidp && sinfo.type == RPMSIG_SIGNATURE_TYPE) - *keyidp = getKeyid(sig); + *keyidp = sinfo.keyid; rpmDigestFinal(ctx, NULL, NULL, 0); } diff --git a/lib/signature.c b/lib/signature.c index a0a77a186..5d4391f71 100644 --- a/lib/signature.c +++ b/lib/signature.c @@ -14,6 +14,7 @@ #include <rpm/rpmkeyring.h> #include <rpm/rpmmacro.h> +#include "rpmio/digest.h" #include "lib/rpmlead.h" #include "lib/signature.h" #include "lib/header_internal.h" @@ -127,6 +128,7 @@ rpmRC rpmSigInfoParse(rpmtd td, const char *origin, goto exit; } sinfo->hashalgo = pgpDigParamsAlgo(sig, PGPVAL_HASHALGO); + sinfo->keyid = pgpGrab(sig->signid+4, 4); } rc = RPMRC_OK; diff --git a/lib/signature.h b/lib/signature.h index db9dd97ba..1d592e363 100644 --- a/lib/signature.h +++ b/lib/signature.h @@ -25,6 +25,7 @@ struct sigtInfo_s { int hashalgo; int range; int type; + unsigned int keyid; }; #ifdef __cplusplus |