]> git.ipfire.org Git - thirdparty/ldns.git/commitdiff
Code review fixes.
authorWillem Toorop <willem@NLnetLabs.nl>
Tue, 17 Jan 2012 11:18:30 +0000 (11:18 +0000)
committerWillem Toorop <willem@NLnetLabs.nl>
Tue, 17 Jan 2012 11:18:30 +0000 (11:18 +0000)
Clarify -S option in ldns-read-zone manpage
Fix spelling of dnssec_trust_tree in doxygen documentation in dnssec_verify.h
Use rfc1982 serial arithmetics when comparing soa serial numbers in ldns_rrsig_check_timestamps, ldns_soa_serial_datecounter and ldns_soa_serial_unixtime.
Thanks Wouter!

dnssec_verify.c
examples/ldns-read-zone.1
ldns/dnssec_verify.h
ldns/rr_functions.h
rr_functions.c

index 18af5d2f0527bb28aab7e20ff6742b5224366a05..503fdd30289e67fb4180b37d07bffcf2e41226aa 100644 (file)
@@ -2108,11 +2108,11 @@ ldns_rrsig_check_timestamps(ldns_rr* rrsig, time_t now)
                /* bad sig, expiration before inception?? Tsssg */
                return LDNS_STATUS_CRYPTO_EXPIRATION_BEFORE_INCEPTION;
        }
-       if (now - inception < 0) {
+       if (((int32_t) now) - inception < 0) {
                /* bad sig, inception date has not yet come to pass */
                return LDNS_STATUS_CRYPTO_SIG_NOT_INCEPTED;
        }
-       if (expiration - now < 0) {
+       if (expiration - ((int32_t) now) < 0) {
                /* bad sig, expiration date has passed */
                return LDNS_STATUS_CRYPTO_SIG_EXPIRED;
        }
index 49cd3e58f701207d387d43154cb731c7cdd27267..81f238d601c51b8345ad85bdc8134897071405dd 100644 (file)
@@ -44,8 +44,8 @@ in datecounter or in unixtime format respectively. Though is the updated serial
 number is smaller than the original one, the original one is simply
 increased by one.
 
-When updating a zone's serial serial number, it will be stripped from DNSSEC
-data as well.
+When updating a serial number, records of type NSEC, NSEC3, RRSIG and DNSKEY
+will be skipped when printing the zone.
 
 
 .TP
index 1350f4858953e34b9f431fa9aadd4151aac89220..32036a8c0b0ffcaa929c4f76f7bc40efa4436065 100644 (file)
@@ -209,7 +209,7 @@ ldns_status ldns_dnssec_trust_tree_add_parent(ldns_dnssec_trust_tree *tree,
                                                                         const ldns_status parent_status);
 
 /**
- * Generates a dnssec_trust_ttree for the given rr from the
+ * Generates a dnssec_trust_tree for the given rr from the
  * given data_chain
  *
  * This does not clone the actual data; Don't free the
@@ -224,7 +224,7 @@ ldns_dnssec_trust_tree *ldns_dnssec_derive_trust_tree(
                                           ldns_rr *rr);
 
 /**
- * Generates a dnssec_trust_ttree for the given rr from the
+ * Generates a dnssec_trust_tree for the given rr from the
  * given data_chain
  *
  * This does not clone the actual data; Don't free the
index 3db3b3dfa84ab1430bc6a255f197f4027c46c167..09a28dd7f8796b2a9351dbb54910c9f1aee1992b 100644 (file)
@@ -268,18 +268,18 @@ typedef uint32_t (*ldns_soa_serial_increment_func_t)(uint32_t, void*);
 /**
  * Function to be used with dns_rr_soa_increment_func_int, to set the soa
  * serial number. 
- * \param[in] _ the (unused) current serial number.
+ * \param[in] unused the (unused) current serial number.
  * \param[in] data the serial number to be set.
  */
-uint32_t ldns_soa_serial_identity(uint32_t _, void *data);
+uint32_t ldns_soa_serial_identity(uint32_t unused, void *data);
 
 /**
  * Function to be used with dns_rr_soa_increment_func, to increment the soa
  * serial number with one. 
  * \param[in] s the current serial number.
- * \param[in] _ unused.
+ * \param[in] unused unused.
  */
-uint32_t ldns_soa_serial_increment(uint32_t s, void *_);
+uint32_t ldns_soa_serial_increment(uint32_t s, void *unused);
 
 /**
  * Function to be used with dns_rr_soa_increment_func_int, to increment the soa
index b4847d62c640f02b242fe9881578e1adca07048b..13bf6a7bedf2bde4c9d4d27511e9efcd94beeadd 100644 (file)
@@ -341,12 +341,12 @@ ldns_rr_dnskey_key_size(const ldns_rr *key)
                                          );
 }
 
-uint32_t ldns_soa_serial_identity(uint32_t ATTR_UNUSED(_), void *data)
+uint32_t ldns_soa_serial_identity(uint32_t ATTR_UNUSED(unused), void *data)
 {
        return (uint32_t) (intptr_t) data;
 }
 
-uint32_t ldns_soa_serial_increment(uint32_t s, void *ATTR_UNUSED(_))
+uint32_t ldns_soa_serial_increment(uint32_t s, void *ATTR_UNUSED(unused))
 {
        return ldns_soa_serial_increment_by(s, (void *)1);
 }
@@ -360,19 +360,19 @@ uint32_t ldns_soa_serial_datecounter(uint32_t s, void *data)
 {
        struct tm tm;
        char s_str[11];
-       uint32_t new_s;
+       int32_t new_s;
        time_t t = data ? (time_t) (intptr_t) data : ldns_time(NULL);
 
        (void) strftime(s_str, 11, "%Y%m%d00", localtime_r(&t, &tm));
-       new_s = (uint32_t) atoi(s_str);
-       return new_s > s ? new_s : s+1;
+       new_s = (int32_t) atoi(s_str);
+       return new_s - ((int32_t) s) < 0 ? s+1 : ((uint32_t) new_s);
 }
 
 uint32_t ldns_soa_serial_unixtime(uint32_t s, void *data)
 {
-       uint32_t new_s = data ? (uint32_t) (intptr_t) data 
-                             : (uint32_t) ldns_time(NULL);
-       return new_s > s ? new_s : s+1;
+       int32_t new_s = data ? (int32_t) (intptr_t) data 
+                            : (int32_t) ldns_time(NULL);
+       return new_s - ((int32_t) s) < 0 ? s+1 : ((uint32_t) new_s);
 }
 
 void