summaryrefslogtreecommitdiff
path: root/rpmio/rpmpgp.c
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2007-11-26 14:19:38 +0200
committerPanu Matilainen <pmatilai@redhat.com>2007-11-26 14:19:38 +0200
commit399dca5c05440350c39008b9e682b95945bc35ff (patch)
tree38a835819d4cebd32d37f216fdb42db5664ef88a /rpmio/rpmpgp.c
parent7ac39db1f4117442b49e4717c79f04295886d9be (diff)
downloadlibrpm-tizen-399dca5c05440350c39008b9e682b95945bc35ff.tar.gz
librpm-tizen-399dca5c05440350c39008b9e682b95945bc35ff.tar.bz2
librpm-tizen-399dca5c05440350c39008b9e682b95945bc35ff.zip
Define and use pgpKeyID_t for pgp key id's
Diffstat (limited to 'rpmio/rpmpgp.c')
-rw-r--r--rpmio/rpmpgp.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/rpmio/rpmpgp.c b/rpmio/rpmpgp.c
index a188a99dc..7b38a3db3 100644
--- a/rpmio/rpmpgp.c
+++ b/rpmio/rpmpgp.c
@@ -888,7 +888,7 @@ int pgpPrtComment(pgpTag tag, const uint8_t *h, unsigned int hlen)
}
int pgpPubkeyFingerprint(const uint8_t * pkt, unsigned int pktlen,
- uint8_t * keyid)
+ pgpKeyID_t keyid)
{
const uint8_t *s = pkt;
DIGEST_CTX ctx;
@@ -907,7 +907,7 @@ int pgpPubkeyFingerprint(const uint8_t * pkt, unsigned int pktlen,
switch (v->pubkey_algo) {
case PGPPUBKEYALGO_RSA:
s += (pgpMpiLen(s) - 8);
- memmove(keyid, s, 8);
+ memmove(keyid, s, sizeof(keyid));
rc = 0;
break;
default: /* TODO: md5 of mpi bodies (i.e. no length) */
@@ -936,7 +936,7 @@ int pgpPubkeyFingerprint(const uint8_t * pkt, unsigned int pktlen,
(void) rpmDigestFinal(ctx, (void **)&SHA1, NULL, 0);
s = SHA1 + 12;
- memmove(keyid, s, 8);
+ memmove(keyid, s, sizeof(keyid));
rc = 0;
if (SHA1) free(SHA1);
@@ -945,7 +945,7 @@ int pgpPubkeyFingerprint(const uint8_t * pkt, unsigned int pktlen,
return rc;
}
-int pgpExtractPubkeyFingerprint(const char * b64pkt, uint8_t * keyid)
+int pgpExtractPubkeyFingerprint(const char * b64pkt, pgpKeyID_t keyid)
{
const uint8_t * pkt;
size_t pktlen;
@@ -954,7 +954,7 @@ int pgpExtractPubkeyFingerprint(const char * b64pkt, uint8_t * keyid)
return -1; /* on error */
(void) pgpPubkeyFingerprint(pkt, pktlen, keyid);
pkt = _free(pkt);
- return 8; /* no. of bytes of pubkey signid */
+ return sizeof(keyid); /* no. of bytes of pubkey signid */
}
int pgpPrtPkt(const uint8_t *pkt, unsigned int pleft)