summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--c_src/dnssec_test.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/c_src/dnssec_test.c b/c_src/dnssec_test.c
new file mode 100644
index 0000000..5390090
--- /dev/null
+++ b/c_src/dnssec_test.c
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2016, NORDUnet A/S.
+ * See LICENSE for licensing information.
+ */
+
+#include <string.h>
+#include <getdns/getdns.h>
+#include "dnssec_test.h"
+
+#define TESTMODE_OK "ok"
+#define TESTMODE_ERR "err"
+
+getdns_return_t
+test_validate(const unsigned char *records,
+ size_t records_len,
+ getdns_list *trust_anchors,
+ const char *testmode)
+{
+ getdns_return_t r = GETDNS_DNSSEC_INDETERMINATE;
+
+ if (strncmp(testmode, TESTMODE_OK, sizeof(TESTMODE_OK)) == 0)
+ {
+ r = GETDNS_RETURN_GOOD;
+ }
+ else if (strncmp(testmode, TESTMODE_ERR, sizeof(TESTMODE_ERR)) == 0)
+ {
+ r = GETDNS_RETURN_GENERIC_ERROR;
+ }
+
+ return r;
+}