summaryrefslogtreecommitdiffstats
path: root/g10/keyid.c
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2006-10-18 17:34:54 +0200
committerWerner Koch <wk@gnupg.org>2006-10-18 17:34:54 +0200
commit971f824f72576db0ffb08b4861e1c45ba97f0007 (patch)
tree92bc930246b89d4f13069c0d6cef5aaaedf5e640 /g10/keyid.c
parentFixed a bug with very long keys. (diff)
downloadgnupg2-971f824f72576db0ffb08b4861e1c45ba97f0007.tar.xz
gnupg2-971f824f72576db0ffb08b4861e1c45ba97f0007.zip
Fixed v3 keyids.
Diffstat (limited to 'g10/keyid.c')
-rw-r--r--g10/keyid.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/g10/keyid.c b/g10/keyid.c
index 99747b6e2..afafc1afd 100644
--- a/g10/keyid.c
+++ b/g10/keyid.c
@@ -159,7 +159,7 @@ do_fingerprint_md_sk( PKT_secret_key *sk )
u32
v3_keyid (gcry_mpi_t a, u32 *ki)
{
- byte *buffer;
+ byte *buffer, *p;
size_t nbytes;
if (gcry_mpi_print (GCRYMPI_FMT_USG, NULL, 0, &nbytes, a ))
@@ -172,8 +172,10 @@ v3_keyid (gcry_mpi_t a, u32 *ki)
ki[0] = ki[1] = 0;
else
{
- memcpy (ki+0, buffer+nbytes-8, 4);
- memcpy (ki+1, buffer+nbytes-4, 4);
+ p = buffer + nbytes - 8;
+ ki[0] = (p[0] << 24) | (p[1] <<16) | (p[2] << 8) | p[3];
+ p += 4;
+ ki[1] = (p[0] << 24) | (p[1] <<16) | (p[2] << 8) | p[3];
}
xfree (buffer);
return ki[1];