- added debug heap size print to memory printout.
- typo fixup in worker.c
- -R needed on solaris.
+ - validator override option for date check testing.
8 August 2007: Wouter
- ldns _raw routines created (in ldns trunk).
# (These examples are from August 2007 and may not be valid anymore).
# trust-anchor: "nlnetlabs.nl. DNSKEY 257 3 5 AQPzzTWMz8qSWIQlfRnPckx2BiVmkVN6LPupO3mbz7FhLSnm26n6iG9N Lby97Ji453aWZY3M5/xJBSOS2vWtco2t8C0+xeO1bc/d6ZTy32DHchpW 6rDH1vp86Ll+ha0tmwyy9QP7y2bVw5zSbFCrefk8qCUBgfHm9bHzMG1U BYtEIQ=="
# trust-anchor: "jelte.nlnetlabs.nl. DS 42860 5 1 14D739EB566D2B1A5E216A0BA4D17FA9B038BE4A"
+
+ # Override the date for validation with a specific fixed date.
+ # Do not set this unless you are debugging signature inception
+ # and expiration. "" or "0" turns the feature off.
+ # val-override-date: ""
# Stub zones.
# Create entries like below, to make all queries for 'example.com' and
*head = s;
return 1;
}
+
+uint32_t
+cfg_convert_timeval(const char* str)
+{
+ uint32_t t;
+ struct tm tm;
+ memset(&tm, 0, sizeof(tm));
+ if(sscanf(str, "%4d%2d%2d%2d%2d%2d", &tm.tm_year, &tm.tm_mon,
+ &tm.tm_mday, &tm.tm_hour, &tm.tm_min, &tm.tm_sec) != 6)
+ return 0;
+ tm.tm_year -= 1900;
+ tm.tm_mon--;
+ /* Check values */
+ if (tm.tm_year < 70) return 0;
+ if (tm.tm_mon < 0 || tm.tm_mon > 11) return 0;
+ if (tm.tm_mday < 1 || tm.tm_mday > 31) return 0;
+ if (tm.tm_hour < 0 || tm.tm_hour > 23) return 0;
+ if (tm.tm_min < 0 || tm.tm_min > 59) return 0;
+ if (tm.tm_sec < 0 || tm.tm_sec > 59) return 0;
+ /* call ldns conversion function */
+ t = mktime_from_utc(&tm);
+ return t;
+}
*/
int cfg_strlist_insert(struct config_strlist** head, char* item);
+/**
+ * Convert 14digit to time value
+ * @param str: string of 14 digits
+ * @return time value or 0 for error.
+ */
+uint32_t cfg_convert_timeval(const char* str);
+
/**
* Used during options parsing
*/
module-conf{COLON} { YDOUT; return VAR_MODULE_CONF;}
trust-anchor-file{COLON} { YDOUT; return VAR_TRUST_ANCHOR_FILE;}
trust-anchor{COLON} { YDOUT; return VAR_TRUST_ANCHOR;}
+val-override-date{COLON} { YDOUT; return VAR_VAL_OVERRIDE_DATE;}
{NEWLINE} { LEXOUT(("NL\n")); cfg_parser->line++;}
/* Quoted strings. Strip leading and ending quotes */
%token VAR_FORWARD_ZONE VAR_FORWARD_HOST VAR_FORWARD_ADDR
%token VAR_DO_NOT_QUERY_ADDRESS VAR_HIDE_IDENTITY VAR_HIDE_VERSION
%token VAR_IDENTITY VAR_VERSION VAR_HARDEN_GLUE VAR_MODULE_CONF
-%token VAR_TRUST_ANCHOR_FILE VAR_TRUST_ANCHOR
+%token VAR_TRUST_ANCHOR_FILE VAR_TRUST_ANCHOR VAR_VAL_OVERRIDE_DATE
%%
toplevelvars: /* empty */ | toplevelvars toplevelvar ;
server_do_not_query_address | server_hide_identity |
server_hide_version | server_identity | server_version |
server_harden_glue | server_module_conf | server_trust_anchor_file |
- server_trust_anchor
+ server_trust_anchor | server_val_override_date
;
stubstart: VAR_STUB_ZONE
{
cfg_parser->cfg->module_conf = $2;
}
;
+server_val_override_date: VAR_VAL_OVERRIDE_DATE STRING
+ {
+ OUTYY(("P(server_val_override_date:%s)\n", $2));
+ if(strlen($2) == 0 || strcmp($2, "0") == 0) {
+ cfg_parser->cfg->val_date_override = 0;
+ } else if(strlen($2) == 14) {
+ cfg_parser->cfg->val_date_override =
+ cfg_convert_timeval($2);
+ if(!cfg_parser->cfg->val_date_override)
+ yyerror("bad date/time specification");
+ } else {
+ if(atoi($2) == 0)
+ yyerror("number expected");
+ cfg_parser->cfg->outgoing_num_ports = atoi($2);
+ }
+ free($2);
+ }
+ ;
stub_name: VAR_NAME STRING
{
OUTYY(("P(name:%s)\n", $2));
incep = ntohl(incep);
/* get current date */
- if(ve->date_override)
+ if(ve->date_override) {
now = ve->date_override;
- else now = (int32_t)time(0);
+ verbose(VERB_ALGO, "date override option %d", (int)now);
+ } else now = (int32_t)time(0);
/* check them */
if(incep - expi > 0) {