diff options
author | Linus Nordberg <linus@nordu.net> | 2016-07-17 03:10:47 +0200 |
---|---|---|
committer | Linus Nordberg <linus@nordu.net> | 2016-07-17 03:10:47 +0200 |
commit | f1ccd459784afec84f812441629917ed3113f093 (patch) | |
tree | 521b926d9333c6e0f5247e45531326f9fda49a5f /c_src | |
parent | 9cf4a5fdbabfbfd87881f161126b122567274b12 (diff) |
Add missing c_src/dnssec_test.c.dnssec2
Diffstat (limited to 'c_src')
-rw-r--r-- | c_src/dnssec_test.c | 31 |
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; +} |