56eba38
commit 374822322e33503d3576c85b3e43fef158a80e42
56eba38
Author: wouter <wouter@be551aaa-1e26-0410-a405-d3ace91eadb9>
56eba38
Date:   Thu Apr 29 12:36:12 2010 +0000
56eba38
56eba38
    dnssec lameness detection looks in key cache if dnssec is expected.
56eba38
56eba38
diff --git a/iterator/iter_utils.c b/iterator/iter_utils.c
56eba38
index 6124650..f63b6fe 100644
56eba38
--- a/iterator/iter_utils.c
56eba38
+++ b/iterator/iter_utils.c
56eba38
@@ -60,6 +60,8 @@
56eba38
 #include "util/random.h"
56eba38
 #include "util/fptr_wlist.h"
56eba38
 #include "validator/val_anchor.h"
56eba38
+#include "validator/val_kcache.h"
56eba38
+#include "validator/val_kentry.h"
56eba38
 
56eba38
 /** time when nameserver glue is said to be 'recent' */
56eba38
 #define SUSPICION_RECENT_EXPIRY 86400
56eba38
@@ -570,6 +572,18 @@ iter_indicates_dnssec(struct module_env* env, struct delegpt* dp,
56eba38
 		reply_find_rrset_section_ns(msg->rep, dp->name, dp->namelen,
56eba38
 		LDNS_RR_TYPE_DS, dclass))
56eba38
 		return 1;
56eba38
+	/* look in key cache */
56eba38
+	if(env->key_cache) {
56eba38
+		struct key_entry_key* kk = key_cache_obtain(env->key_cache,
56eba38
+			dp->name, dp->namelen, dclass, env->scratch, *env->now);
56eba38
+		if(kk) {
56eba38
+			if(key_entry_isgood(kk) || key_entry_isbad(kk)) {
56eba38
+				regional_free_all(env->scratch);
56eba38
+				return 1;
56eba38
+			}
56eba38
+			regional_free_all(env->scratch);
56eba38
+		}
56eba38
+	}
56eba38
 	return 0;
56eba38
 }
56eba38