mirror of
https://github.com/pi-hole/dnsmasq.git
synced 2025-12-19 10:18:25 +00:00
Fix Byte-order botch: broke DNSSEC on big-endian platforms.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user