projects
/
platform
/
upstream
/
rpm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
37a35d0
)
Fix PGP v4 fingerprint calculation (rhbz#493777)
author
Panu Matilainen
<pmatilai@redhat.com>
Thu, 9 Apr 2009 10:05:00 +0000
(13:05 +0300)
committer
Panu Matilainen
<pmatilai@redhat.com>
Thu, 9 Apr 2009 10:05:00 +0000
(13:05 +0300)
- patch from openSUSE / Michael Schroeder
rpmio/rpmpgp.c
patch
|
blob
|
history
diff --git
a/rpmio/rpmpgp.c
b/rpmio/rpmpgp.c
index
2fec32f
..
e671552
100644
(file)
--- a/
rpmio/rpmpgp.c
+++ b/
rpmio/rpmpgp.c
@@
-1087,6
+1087,7
@@
int pgpPubkeyFingerprint(const uint8_t * pkt, size_t pktlen, pgpKeyID_t keyid)
case 4:
{ pgpPktKeyV4 v = (pgpPktKeyV4) (h);
uint8_t * d = NULL;
+ uint8_t in[3];
size_t dlen;
int i;
@@
-1103,7
+1104,12
@@
int pgpPubkeyFingerprint(const uint8_t * pkt, size_t pktlen, pgpKeyID_t keyid)
}
ctx = rpmDigestInit(PGPHASHALGO_SHA1, RPMDIGEST_NONE);
- (void) rpmDigestUpdate(ctx, pkt, (se-pkt));
+ i = se - h;
+ in[0] = 0x99;
+ in[1] = i >> 8;
+ in[2] = i;
+ (void) rpmDigestUpdate(ctx, in, 3);
+ (void) rpmDigestUpdate(ctx, h, i);
(void) rpmDigestFinal(ctx, (void **)&d, &dlen, 0);
if (d) {