Commit 1633e308 authored by Simon Kelley's avatar Simon Kelley

Fix Byte-order botch: broke DNSSEC on big-endian platforms.

parent c8ca33f8
......@@ -1374,12 +1374,12 @@ int dnskey_keytag(int alg, int flags, unsigned char *key, int keylen)
}
else
{
unsigned long ac;
unsigned long ac = flags + 0x300 + alg;
int i;
ac = ((htons(flags) >> 8) | ((htons(flags) << 8) & 0xff00)) + 0x300 + alg;
for (i = 0; i < keylen; ++i)
ac += (i & 1) ? key[i] : key[i] << 8;
ac += (ac >> 16) & 0xffff;
return ac & 0xffff;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment