summaryrefslogtreecommitdiff
path: root/rpmio
diff options
context:
space:
mode:
authorjbj <devnull@localhost>2002-08-02 16:39:55 +0000
committerjbj <devnull@localhost>2002-08-02 16:39:55 +0000
commit31e9a0f278402dd5243bbb6c38d03080073836b4 (patch)
tree82c8494e6c20230b28ca3c03e46266030a0f2a0b /rpmio
parent4a58c73baa5212da005a5192f60a77fdfa8601ec (diff)
downloadlibrpm-tizen-31e9a0f278402dd5243bbb6c38d03080073836b4.tar.gz
librpm-tizen-31e9a0f278402dd5243bbb6c38d03080073836b4.tar.bz2
librpm-tizen-31e9a0f278402dd5243bbb6c38d03080073836b4.zip
- fix: signed pubkeys were imported incorrectly (#68291).
- include tgpg script to verify signatures using only gpg. CVS patchset: 5593 CVS date: 2002/08/02 16:39:55
Diffstat (limited to 'rpmio')
-rw-r--r--rpmio/rpmpgp.c20
-rw-r--r--rpmio/rpmpgp.h3
2 files changed, 9 insertions, 14 deletions
diff --git a/rpmio/rpmpgp.c b/rpmio/rpmpgp.c
index 31ab41da2..5b7108d0e 100644
--- a/rpmio/rpmpgp.c
+++ b/rpmio/rpmpgp.c
@@ -346,7 +346,7 @@ fprintf(stderr, "\t %s ", pre), mp32println(stderr, mpn->size, mpn->data);
}
/*@=boundswrite@*/
-int pgpPrtSubType(const byte *h, unsigned int hlen)
+int pgpPrtSubType(const byte *h, unsigned int hlen, pgpSigType sigtype)
{
const byte *p = h;
unsigned plen;
@@ -377,11 +377,8 @@ int pgpPrtSubType(const byte *h, unsigned int hlen)
/*@switchbreak@*/ break;
case PGPSUBTYPE_SIG_CREATE_TIME:
/*@-mods -mayaliasunique @*/
-#ifdef DYING
- if (_digp && _digp->tag == PGPTAG_PUBLIC_KEY)
-#else
- if (_digp && !(_digp->saved & PGPDIG_SAVED_TIME))
-#endif
+ if (sigtype == PGPSIGTYPE_POSITIVE_CERT &&
+ _digp && !(_digp->saved & PGPDIG_SAVED_TIME))
{
_digp->saved |= PGPDIG_SAVED_TIME;
memcpy(_digp->time, p+1, sizeof(_digp->time));
@@ -400,11 +397,8 @@ int pgpPrtSubType(const byte *h, unsigned int hlen)
case PGPSUBTYPE_ISSUER_KEYID: /* issuer key ID */
/*@-mods -mayaliasunique @*/
-#ifdef DYING
- if (_digp && _digp->tag == PGPTAG_PUBLIC_KEY)
-#else
- if (_digp && !(_digp->saved & PGPDIG_SAVED_ID))
-#endif
+ if (sigtype == PGPSIGTYPE_POSITIVE_CERT &&
+ _digp && !(_digp->saved & PGPDIG_SAVED_ID))
{
_digp->saved |= PGPDIG_SAVED_ID;
memcpy(_digp->signid, p+1, sizeof(_digp->signid));
@@ -586,7 +580,7 @@ fprintf(stderr, " hash[%u] -- %s\n", plen, pgpHexStr(p, plen));
_digp->hash = memcpy(xmalloc(_digp->hashlen), v, _digp->hashlen);
}
/*@=mods@*/
- (void) pgpPrtSubType(p, plen);
+ (void) pgpPrtSubType(p, plen, v->sigtype);
p += plen;
plen = pgpGrab(p,2);
@@ -594,7 +588,7 @@ fprintf(stderr, " hash[%u] -- %s\n", plen, pgpHexStr(p, plen));
if (_debug && _print)
fprintf(stderr, " unhash[%u] -- %s\n", plen, pgpHexStr(p, plen));
- (void) pgpPrtSubType(p, plen);
+ (void) pgpPrtSubType(p, plen, v->sigtype);
p += plen;
plen = pgpGrab(p,2);
diff --git a/rpmio/rpmpgp.h b/rpmio/rpmpgp.h
index 962a1ce9f..05d238c54 100644
--- a/rpmio/rpmpgp.h
+++ b/rpmio/rpmpgp.h
@@ -1144,9 +1144,10 @@ void pgpPrtVal(const char * pre, pgpValTbl vs, byte val)
* Print/parse an OpenPGP subtype packet.
* @param h packet
* @param hlen packet length (no. of bytes)
+ * @param sigtype signature type
* @return 0 on success
*/
-int pgpPrtSubType(const byte *h, unsigned int hlen)
+int pgpPrtSubType(const byte *h, unsigned int hlen, pgpSigType sigtype)
/*@globals fileSystem @*/
/*@modifies fileSystem @*/;