]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- For #762: remove relocated code.
authorGeorge Thessalonikefs <george@nlnetlabs.nl>
Wed, 2 Aug 2023 13:51:05 +0000 (15:51 +0200)
committerGeorge Thessalonikefs <george@nlnetlabs.nl>
Wed, 2 Aug 2023 13:51:05 +0000 (15:51 +0200)
util/data/msgparse.c
validator/val_sigcrypt.c

index 1a7754c3d87fe6adbf54b2df48fda01e8807a922..33002ddcabd3811973744bf275c979f753e25aa4 100644 (file)
@@ -942,44 +942,6 @@ parse_packet(sldns_buffer* pkt, struct msg_parse* msg, struct regional* region)
        return 0;
 }
 
-///** RFC 1982 comparison, uses unsigned integers, and tries to avoid
-// * compiler optimization (eg. by avoiding a-b<0 comparisons),
-// * this routine matches compare_serial(), for SOA serial number checks */
-//static int
-//compare_1982(uint32_t a, uint32_t b)
-//{
-//     /* for 32 bit values */
-//     const uint32_t cutoff = ((uint32_t) 1 << (32 - 1));
-//
-//     if (a == b) {
-//             return 0;
-//     } else if ((a < b && b - a < cutoff) || (a > b && a - b > cutoff)) {
-//             return -1;
-//     } else {
-//             return 1;
-//     }
-//}
-//
-///** if we know that b is larger than a, return the difference between them,
-// * that is the distance between them. in RFC1982 arith */
-//static uint32_t
-//subtract_1982(uint32_t a, uint32_t b)
-//{
-//     /* for 32 bit values */
-//     const uint32_t cutoff = ((uint32_t) 1 << (32 - 1));
-//
-//     if(a == b)
-//             return 0;
-//     if(a < b && b - a < cutoff) {
-//             return b-a;
-//     }
-//     if(a > b && a - b > cutoff) {
-//             return ((uint32_t)0xffffffff) - (a-b-1);
-//     }
-//     /* wrong case, b smaller than a */
-//     return 0;
-//}
-
 
 static uint8_t *
 cookie_hash(uint8_t *hash, uint8_t *buf,
index 8f05591e50faf7fbecddd6713e593c8ed3336245..215f9ad857d73dfcaf08b813472a42bdb4823c6c 100644 (file)
@@ -1379,44 +1379,6 @@ sigdate_error(const char* str, int32_t expi, int32_t incep, int32_t now)
                        (unsigned)incep, (unsigned)now);
 }
 
-///** RFC 1982 comparison, uses unsigned integers, and tries to avoid
-// * compiler optimization (eg. by avoiding a-b<0 comparisons),
-// * this routine matches compare_serial(), for SOA serial number checks */
-//static int
-//compare_1982(uint32_t a, uint32_t b)
-//{
-//     /* for 32 bit values */
-//        const uint32_t cutoff = ((uint32_t) 1 << (32 - 1));
-//
-//        if (a == b) {
-//                return 0;
-//        } else if ((a < b && b - a < cutoff) || (a > b && a - b > cutoff)) {
-//                return -1;
-//        } else {
-//                return 1;
-//        }
-//}
-//
-///** if we know that b is larger than a, return the difference between them,
-// * that is the distance between them. in RFC1982 arith */
-//static uint32_t
-//subtract_1982(uint32_t a, uint32_t b)
-//{
-//     /* for 32 bit values */
-//        const uint32_t cutoff = ((uint32_t) 1 << (32 - 1));
-//
-//     if(a == b)
-//             return 0;
-//     if(a < b && b - a < cutoff) {
-//             return b-a;
-//     }
-//     if(a > b && a - b > cutoff) {
-//             return ((uint32_t)0xffffffff) - (a-b-1);
-//     }
-//     /* wrong case, b smaller than a */
-//     return 0;
-//}
-
 /** check rrsig dates */
 static int
 check_dates(struct val_env* ve, uint32_t unow, uint8_t* expi_p,