]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Revert "Merge branch '996-wrong-key-id-is-displayed-for-rsamd5-keys' into 'master'"
authorOndřej Surý <ondrej@sury.org>
Wed, 29 May 2019 13:17:04 +0000 (15:17 +0200)
committerOndřej Surý <ondrej@sury.org>
Wed, 29 May 2019 13:34:08 +0000 (15:34 +0200)
This reverts commit ea131d2e6a937964b65b9ccc4cd3f18de9f6d09f, reversing
changes made to e79dd268b6fb36b897a3258cdf959d87f60e55e0.

CHANGES
lib/dns/key.c

diff --git a/CHANGES b/CHANGES
index 7a6066f87d8f90f54260fac0bf3d140d3cf0d479..9accfda9c13d1a5ee75b767332c65c680bc3b6f8 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,5 @@
+5240.  [bug]           Remove key id calculation for RSAMD5. [GL #996]
+
 5239.  [func]          Change the json-c detection to pkg-config. [GL #855]
 
 5238.  [bug]           Fix a possible deadlock in TCP code. [GL #1046]
index 991394acd0b65d984706ad50932bf05f6b57c3f4..61aaa17f0c99f0aff6fd6651b01ab3dfbed56093 100644 (file)
@@ -35,17 +35,11 @@ dst_region_computeid(const isc_region_t *source) {
        p = source->base;
        size = source->length;
 
-       if (source->base[3] == DST_ALG_RSAMD5) {
-               return ((p[size - 3] << 8) + p[size - 2]);
-       }
-
-       for (ac = 0; size > 1; size -= 2, p += 2) {
+       for (ac = 0; size > 1; size -= 2, p += 2)
                ac += ((*p) << 8) + *(p + 1);
-       }
 
-       if (size > 0) {
+       if (size > 0)
                ac += ((*p) << 8);
-       }
        ac += (ac >> 16) & 0xffff;
 
        return ((uint16_t)(ac & 0xffff));
@@ -63,23 +57,13 @@ dst_region_computerid(const isc_region_t *source) {
        p = source->base;
        size = source->length;
 
-       if (source->base[3] == DST_ALG_RSAMD5) {
-               ac = (p[size - 3] << 8) + p[size - 2];
-               if (size == 4U) {
-                       ac |= (DNS_KEYFLAG_REVOKE<<8);
-               }
-               return (ac);
-       }
-
        ac = ((*p) << 8) + *(p + 1);
        ac |= DNS_KEYFLAG_REVOKE;
-       for (size -= 2, p +=2; size > 1; size -= 2, p += 2) {
+       for (size -= 2, p +=2; size > 1; size -= 2, p += 2)
                ac += ((*p) << 8) + *(p + 1);
-       }
 
-       if (size > 0) {
+       if (size > 0)
                ac += ((*p) << 8);
-       }
        ac += (ac >> 16) & 0xffff;
 
        return ((uint16_t)(ac & 0xffff));