Replace remaing rpmSigTag uses with rpmTagVal

- Some of these might actually be "correct" but about one case from
  librpmbuild cascades down here ... just not worth the trouble to
  keep the as rpmSigTags.
This commit is contained in:
Panu Matilainen 2010-10-22 13:23:09 +03:00
parent ac2efca814
commit 65358a072f
3 changed files with 11 additions and 11 deletions

View File

@ -117,7 +117,7 @@ static int putSignature(Header sigh, int ishdr, uint8_t *pkt, size_t pktlen)
{
pgpDig dig = pgpNewDig();
pgpDigParams sigp = &dig->signature;
rpmSigTag sigtag;
rpmTagVal sigtag;
struct rpmtd_s sigtd;
int rc = 1; /* assume failure */
@ -334,7 +334,7 @@ static int rpmGenSignature(Header sigh, const char * file,
* @param sigtag signature tag
* @return parsed pgp dig or NULL
*/
static pgpDig getSig(Header sigh, rpmSigTag sigtag)
static pgpDig getSig(Header sigh, rpmTagVal sigtag)
{
struct rpmtd_s pkt;
pgpDig dig = NULL;
@ -359,7 +359,7 @@ static void deleteSigs(Header sigh)
headerDel(sigh, RPMSIGTAG_PGP5);
}
static int sameSignature(rpmSigTag sigtag, Header h1, Header h2)
static int sameSignature(rpmTagVal sigtag, Header h1, Header h2)
{
pgpDig dig1 = getSig(h1, sigtag);
pgpDig dig2 = getSig(h2, sigtag);
@ -408,7 +408,7 @@ static int replaceSignature(Header sigh, const char *sigtarget,
*/
if (rpmGenSignature(sigh, sigtarget, passPhrase) == 0) {
/* Lets see what we got and whether its the same signature as before */
rpmSigTag sigtag = headerIsEntry(sigh, RPMSIGTAG_DSA) ?
rpmTagVal sigtag = headerIsEntry(sigh, RPMSIGTAG_DSA) ?
RPMSIGTAG_DSA : RPMSIGTAG_RSA;
rc = sameSignature(sigtag, sigh, oldsigh);
@ -515,11 +515,11 @@ static int rpmSign(const char *rpm, int deleting, const char *passPhrase)
/* Toss and recalculate header+payload size and digests. */
{
rpmSigTag const sigs[] = { RPMSIGTAG_SIZE,
rpmTagVal const sigs[] = { RPMSIGTAG_SIZE,
RPMSIGTAG_MD5,
RPMSIGTAG_SHA1,
};
int nsigs = sizeof(sigs) / sizeof(rpmSigTag);
int nsigs = sizeof(sigs) / sizeof(rpmTagVal);
for (int i = 0; i < nsigs; i++) {
(void) headerDel(sigh, sigs[i]);
if (rpmGenDigest(sigh, sigtarget, sigs[i]))

View File

@ -20,7 +20,7 @@
#include "debug.h"
/* Dumb wrapper around headerPut() for signature header */
static int sighdrPut(Header h, rpmSigTag tag, rpmTagType type,
static int sighdrPut(Header h, rpmTagVal tag, rpmTagType type,
rpm_data_t p, rpm_count_t c)
{
struct rpmtd_s sigtd;
@ -151,7 +151,7 @@ rpmRC rpmReadSignature(FD_t fd, Header * sighp, sigType sig_type, char ** msg)
(void) memcpy(&info, dataEnd, REGION_TAG_COUNT);
/* XXX Really old packages have HEADER_IMAGE, not HEADER_SIGNATURES. */
if (info.tag == htonl(RPMTAG_HEADERIMAGE)) {
rpmSigTag stag = htonl(RPMTAG_HEADERSIGNATURES);
rpmTagVal stag = htonl(RPMTAG_HEADERSIGNATURES);
info.tag = stag;
memcpy(dataEnd, &stag, sizeof(stag));
}
@ -276,7 +276,7 @@ Header rpmFreeSignature(Header sigh)
return headerFree(sigh);
}
static int makeHDRDigest(Header sigh, const char * file, rpmSigTag sigTag)
static int makeHDRDigest(Header sigh, const char * file, rpmTagVal sigTag)
{
Header h = NULL;
FD_t fd = NULL;
@ -328,7 +328,7 @@ exit:
return ret;
}
int rpmGenDigest(Header sigh, const char * file, rpmSigTag sigTag)
int rpmGenDigest(Header sigh, const char * file, rpmTagVal sigTag)
{
struct stat st;
uint8_t * pkt = NULL;

View File

@ -51,7 +51,7 @@ int rpmWriteSignature(FD_t fd, Header h);
* @param sigTag type of digest(s) to add
* @return 0 on success, -1 on failure
*/
int rpmGenDigest(Header sigh, const char * file, rpmSigTag sigTag);
int rpmGenDigest(Header sigh, const char * file, rpmTagVal sigTag);
/** \ingroup signature
* Verify a signature from a package.