commit | 1633e3083445e7e6fa6dcb948a4fcf1fe41c814b | [log] [tgz] |
---|---|---|
author | Simon Kelley <simon@thekelleys.org.uk> | Mon Feb 10 16:42:46 2014 +0000 |
committer | Simon Kelley <simon@thekelleys.org.uk> | Mon Feb 10 16:42:46 2014 +0000 |
tree | 03cf3ddca6879ebddfc1ab15f807915ac70fc686 | |
parent | c8ca33f810e25e15296926f569c8e82420d5fdd3 [diff] |
Fix Byte-order botch: broke DNSSEC on big-endian platforms.
diff --git a/src/dnssec.c b/src/dnssec.c index b97f47b..002afbc 100644 --- a/src/dnssec.c +++ b/src/dnssec.c
@@ -1374,12 +1374,12 @@ } 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; }