From: Evan Hunt Date: Thu, 1 Mar 2018 18:07:49 +0000 (-0800) Subject: migrate t_dst signature test to lib/dns/tests/dst_test X-Git-Tag: v9.13.0~101^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a4ebe83cdb053ebd76f55200f5b1e293a3ddc4d8;p=thirdparty%2Fbind9.git migrate t_dst signature test to lib/dns/tests/dst_test --- diff --git a/bin/tests/.gitignore b/bin/tests/.gitignore index ec63c56fa2e..fe9052ac52c 100644 --- a/bin/tests/.gitignore +++ b/bin/tests/.gitignore @@ -5,7 +5,6 @@ nxtify sdig *_test gsstest -t_dst conf.sh dlopen keycreate diff --git a/bin/tests/Makefile.in b/bin/tests/Makefile.in index f4605f3ff1a..ca7d0c7ddbf 100644 --- a/bin/tests/Makefile.in +++ b/bin/tests/Makefile.in @@ -32,7 +32,7 @@ ISCCFGDEPLIBS = ../../lib/isccfg/libisccfg.@A@ LIBS = @LIBS@ -SUBDIR = dst system @PKCS11_TOOLS@ optional +SUBDIR = system @PKCS11_TOOLS@ optional TESTDIRS = system diff --git a/bin/tests/dst/.gitignore b/bin/tests/dst/.gitignore deleted file mode 100644 index a46cbd6f202..00000000000 --- a/bin/tests/dst/.gitignore +++ /dev/null @@ -1,16 +0,0 @@ -randomfile -Kdh.+002+18602.key -Kdh.+002+18602.private -Kdh.+002+48957.key -Kdh.+002+48957.private -Ktest.+001+00002.key -Ktest.+001+54622.key -Ktest.+001+54622.private -Ktest.+003+23616.key -Ktest.+003+23616.private -Ktest.+003+49667.key -dst_2_data -t2_data_1 -t2_data_2 -t2_dsasig -t2_rsasig diff --git a/bin/tests/dst/Kdh.+002+18602.key.in b/bin/tests/dst/Kdh.+002+18602.key.in deleted file mode 100644 index 09b4cf56aa0..00000000000 --- a/bin/tests/dst/Kdh.+002+18602.key.in +++ /dev/null @@ -1 +0,0 @@ -dh. IN KEY 0 2 2 AAEBAAAAYIHI/wjtOagNga9GILSoS02IVelgLilPE/TfhtvShsiDAXqb IfxQcj2JkuOnNLs5ttb2WZXWl5/jsSjIxHMwMF2XY4gwt/lwHBf/vgYH r7aIxnKXov1jk9rymTLHGKIOtg== diff --git a/bin/tests/dst/Kdh.+002+18602.private.in b/bin/tests/dst/Kdh.+002+18602.private.in deleted file mode 100644 index a2245bfa34d..00000000000 --- a/bin/tests/dst/Kdh.+002+18602.private.in +++ /dev/null @@ -1,6 +0,0 @@ -Private-key-format: v1.2 -Algorithm: 2 (DH) -Prime(p): ///////////JD9qiIWjCNMTGYouA3BzRKQJOCIpnzHQCC76mOxObIlFKCHmONATd75UZs806QxswKwpt8l8UN0/hNW1tUcJF5IW1dmJefsb0TELppjo2IP////////// -Generator(g): Ag== -Private_value(x): bpdsGQ1jbV3f2CGN/0Pk5KM1MlkFmMryPO1J1zoGn585fRmc9Ygw6l/HKmi2ViiDNorvd9/eV9uyYO6lYZC82R3D7rST1mAqCwbg/8gNE5dXBRbRIIq3qIl6GUYYs8mK -Public_value(y): gcj/CO05qA2Br0YgtKhLTYhV6WAuKU8T9N+G29KGyIMBepsh/FByPYmS46c0uzm21vZZldaXn+OxKMjEczAwXZdjiDC3+XAcF/++BgevtojGcpei/WOT2vKZMscYog62 diff --git a/bin/tests/dst/Kdh.+002+48957.key.in b/bin/tests/dst/Kdh.+002+48957.key.in deleted file mode 100644 index 98388295efa..00000000000 --- a/bin/tests/dst/Kdh.+002+48957.key.in +++ /dev/null @@ -1 +0,0 @@ -dh. IN KEY 0 2 2 AAEBAAAAYOuaKjyMXYame2F6/ZFdEmXv0a2edB+69PEZgrExA6SJlivn 4KqAsfBHr/+0BCb+7nfWeMDSh2BXnSzWkXF1wMaCHMuz9EleG1gKFKeV Q9gKli88Cb8/jbovWChrGBNp2w== diff --git a/bin/tests/dst/Kdh.+002+48957.private.in b/bin/tests/dst/Kdh.+002+48957.private.in deleted file mode 100644 index e191235c89a..00000000000 --- a/bin/tests/dst/Kdh.+002+48957.private.in +++ /dev/null @@ -1,6 +0,0 @@ -Private-key-format: v1.2 -Algorithm: 2 (DH) -Prime(p): ///////////JD9qiIWjCNMTGYouA3BzRKQJOCIpnzHQCC76mOxObIlFKCHmONATd75UZs806QxswKwpt8l8UN0/hNW1tUcJF5IW1dmJefsb0TELppjo2IP////////// -Generator(g): Ag== -Private_value(x): WJG0moh+QoZV+DYhqW7Z6O6TYpYGtSlN0Ym6JV6VRnzeH69OqMUFivqZorj3a3ofR/4zogNVyy5KLLj2NFTaLGP4Hcvt7uETJik6HrjLMhGf40QPXYgVK57Im0rv88Ca -Public_value(y): 65oqPIxdhqZ7YXr9kV0SZe/RrZ50H7r08RmCsTEDpImWK+fgqoCx8Eev/7QEJv7ud9Z4wNKHYFedLNaRcXXAxoIcy7P0SV4bWAoUp5VD2AqWLzwJvz+Nui9YKGsYE2nb diff --git a/bin/tests/dst/Makefile.in b/bin/tests/dst/Makefile.in deleted file mode 100644 index ec802e82ffd..00000000000 --- a/bin/tests/dst/Makefile.in +++ /dev/null @@ -1,69 +0,0 @@ -# Copyright (C) Internet Systems Consortium, Inc. ("ISC") -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. -# -# See the COPYRIGHT file distributed with this work for additional -# information regarding copyright ownership. - -srcdir = @srcdir@ -VPATH = @srcdir@ -top_srcdir = @top_srcdir@ - -@BIND9_MAKE_INCLUDES@ - -CINCLUDES = ${TEST_INCLUDES} ${DNS_INCLUDES} \ - ${ISC_INCLUDES} @DST_OPENSSL_INC@ - -CDEFINES = @CRYPTO@ -CWARNINGS = - -DNSLIBS = ../../../lib/dns/libdns.@A@ @DNS_CRYPTO_LIBS@ -ISCLIBS = ../../../lib/isc/libisc.@A@ @ISC_OPENSSL_LIBS@ - -DNSDEPLIBS = ../../../lib/dns/libdns.@A@ -ISCDEPLIBS = ../../../lib/isc/libisc.@A@ - -DEPLIBS = ${DNSDEPLIBS} ${ISCDEPLIBS} - -LIBS = ${DNSLIBS} ${ISCLIBS} @LIBS@ - -TLIB = ../../../lib/tests/libt_api.@A@ - -TARGETS = t_dst@EXEEXT@ - -SRCS = t_dst.c - -@BIND9_MAKE_RULES@ - -t_dst@EXEEXT@: t_dst.@O@ ${DEPLIBS} ${TLIB} - ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ \ - t_dst.@O@ ${TLIB} ${LIBS} - -test: t_dst@EXEEXT@ randomfile - ../../tools/genrandom@EXEEXT@ 100 randomfile - -@ ./t_dst@EXEEXT@ -q 1800 -a - -randomfile: - ../../tools/genrandom@EXEEXT@ 100 randomfile - -clean distclean:: - rm -f ${TARGETS} randomfile - -distclean:: - rm -f Kdh.+002+18602.key - rm -f Kdh.+002+18602.private - rm -f Kdh.+002+48957.key - rm -f Kdh.+002+48957.private - rm -f Ktest.+001+00002.key - rm -f Ktest.+001+54622.key - rm -f Ktest.+001+54622.private - rm -f Ktest.+003+23616.key - rm -f Ktest.+003+23616.private - rm -f Ktest.+003+49667.key - rm -f dst_2_data - rm -f t2_data_1 - rm -f t2_data_2 - rm -f t2_dsasig - rm -f t2_rsasig diff --git a/bin/tests/dst/dst_2_data.in b/bin/tests/dst/dst_2_data.in deleted file mode 100644 index a3030651b32..00000000000 --- a/bin/tests/dst/dst_2_data.in +++ /dev/null @@ -1,16 +0,0 @@ -# -# data for signature verification test -# -# format: -# datafile, sigpath, keyname, keyid, alg, exp_result -# -t2_data_1 t2_dsasig test. 23616 DST_ALG_DSA ISC_R_SUCCESS -t2_data_1 t2_rsasig test. 54622 DST_ALG_RSAMD5 ISC_R_SUCCESS -# wrong sig -t2_data_1 t2_dsasig test. 54622 DST_ALG_RSAMD5 !ISC_R_SUCCESS -# wrong key -#t2_data_1 t2_dsasig test. 54622 DST_ALG_DSA !ISC_R_SUCCESS -# wrong alg -#t2_data_1 t2_dsasig test. 23616 DST_ALG_RSAMD5 !ISC_R_SUCCESS -# wrong data -t2_data_2 t2_dsasig test. 23616 DST_ALG_DSA !ISC_R_SUCCESS diff --git a/bin/tests/dst/t_dst.c b/bin/tests/dst/t_dst.c deleted file mode 100644 index b702e4c0827..00000000000 --- a/bin/tests/dst/t_dst.c +++ /dev/null @@ -1,1045 +0,0 @@ -/* - * Copyright (C) Internet Systems Consortium, Inc. ("ISC") - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * See the COPYRIGHT file distributed with this work for additional - * information regarding copyright ownership. - */ - -/* $Id: t_dst.c,v 1.60 2011/03/17 23:47:29 tbox Exp $ */ - -#include - -#include -#include -#include -#include - -#ifndef WIN32 -#include /* XXX */ -#else -#include -#endif - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include -#include - -#include - -#ifndef PATH_MAX -#define PATH_MAX 256 -#endif - -/* - * Adapted from the original dst_test.c program. - */ - -static void -cleandir(char *path) { - isc_dir_t dir; - char fullname[PATH_MAX + 1]; - size_t l; - isc_result_t ret; - - isc_dir_init(&dir); - ret = isc_dir_open(&dir, path); - if (ret != ISC_R_SUCCESS) { - t_info("isc_dir_open(%s) failed %s\n", - path, isc_result_totext(ret)); - return; - } - - while (isc_dir_read(&dir) == ISC_R_SUCCESS) { - if (!strcmp(dir.entry.name, ".")) - continue; - if (!strcmp(dir.entry.name, "..")) - continue; - (void)strlcpy(fullname, path, sizeof(fullname)); - (void)strlcat(fullname, "/", sizeof(fullname)); - l = strlcat(fullname, dir.entry.name, sizeof(fullname)); - if (l < sizeof(fullname)) { - if (remove(fullname)) - t_info("remove(%s) failed %d\n", fullname, - errno); - } else - t_info("unable to remove '%s/%s': path too long\n", - path, dir.entry.name); - - } - isc_dir_close(&dir); - if (rmdir(path)) - t_info("rmdir(%s) failed %d\n", path, errno); - - return; -} - -static void -use(dst_key_t *key, isc_mem_t *mctx, isc_result_t exp_result, int *nfails) { - - isc_result_t ret; - const char *data = "This is some data"; - unsigned char sig[512]; - isc_buffer_t databuf, sigbuf; - isc_region_t datareg, sigreg; - dst_context_t *ctx = NULL; - - isc_buffer_init(&sigbuf, sig, sizeof(sig)); - isc_buffer_constinit(&databuf, data, strlen(data)); - isc_buffer_add(&databuf, strlen(data)); - isc_buffer_usedregion(&databuf, &datareg); - - ret = dst_context_create3(key, mctx, - DNS_LOGCATEGORY_GENERAL, ISC_TRUE, &ctx); - if (ret != exp_result) { - t_info("dst_context_create(%d) returned (%s) expected (%s)\n", - dst_key_alg(key), dst_result_totext(ret), - dst_result_totext(exp_result)); - ++*nfails; - return; - } - if (exp_result != ISC_R_SUCCESS) - return; - ret = dst_context_adddata(ctx, &datareg); - if (ret != ISC_R_SUCCESS) { - t_info("dst_context_adddata(%d) returned (%s)\n", - dst_key_alg(key), dst_result_totext(ret)); - ++*nfails; - dst_context_destroy(&ctx); - return; - } - ret = dst_context_sign(ctx, &sigbuf); - if (ret != ISC_R_SUCCESS) { - t_info("dst_context_sign(%d) returned (%s)\n", - dst_key_alg(key), dst_result_totext(ret)); - ++*nfails; - dst_context_destroy(&ctx); - return; - } - dst_context_destroy(&ctx); - - isc_buffer_remainingregion(&sigbuf, &sigreg); - ret = dst_context_create3(key, mctx, - DNS_LOGCATEGORY_GENERAL, ISC_FALSE, &ctx); - if (ret != ISC_R_SUCCESS) { - t_info("dst_context_create(%d) returned (%s)\n", - dst_key_alg(key), dst_result_totext(ret)); - ++*nfails; - return; - } - ret = dst_context_adddata(ctx, &datareg); - if (ret != ISC_R_SUCCESS) { - t_info("dst_context_adddata(%d) returned (%s)\n", - dst_key_alg(key), dst_result_totext(ret)); - ++*nfails; - dst_context_destroy(&ctx); - return; - } - ret = dst_context_verify(ctx, &sigreg); - if (ret != exp_result) { - t_info("dst_context_verify(%d) returned (%s) expected (%s)\n", - dst_key_alg(key), dst_result_totext(ret), - dst_result_totext(exp_result)); - ++*nfails; - dst_context_destroy(&ctx); - return; - } - dst_context_destroy(&ctx); -} - -static void -dh(dns_name_t *name1, int id1, dns_name_t *name2, int id2, isc_mem_t *mctx, - isc_result_t exp_result, int *nfails, int *nprobs) -{ - dst_key_t *key1 = NULL, *key2 = NULL; - isc_result_t ret; - char current[PATH_MAX + 1]; - char tmp[PATH_MAX + 1]; - char *p; - int alg = DST_ALG_DH; - int type = DST_TYPE_PUBLIC|DST_TYPE_PRIVATE|DST_TYPE_KEY; - unsigned char array1[1024], array2[1024]; - isc_buffer_t b1, b2; - isc_region_t r1, r2; - - UNUSED(exp_result); - - p = getcwd(current, PATH_MAX);; - if (p == NULL) { - t_info("getcwd failed %d\n", errno); - ++*nprobs; - goto cleanup; - } - - ret = dst_key_fromfile(name1, id1, alg, type, current, mctx, &key1); - if (ret != ISC_R_SUCCESS) { - t_info("dst_key_fromfile(%d) returned: %s\n", - alg, dst_result_totext(ret)); - ++*nfails; - goto cleanup; - } - - ret = dst_key_fromfile(name2, id2, alg, type, current, mctx, &key2); - if (ret != ISC_R_SUCCESS) { - t_info("dst_key_fromfile(%d) returned: %s\n", - alg, dst_result_totext(ret)); - ++*nfails; - goto cleanup; - } - -#ifndef WIN32 - ret = isc_file_mktemplate("/tmp/", tmp, sizeof(tmp)); -#else - ret = isc_file_mktemplate(getenv("TEMP"), tmp, sizeof(tmp)); -#endif - if (ret != ISC_R_SUCCESS) { - t_info("isc_file_mktemplate failed %s\n", - isc_result_totext(ret)); - ++*nprobs; - goto cleanup; - } - - ret = isc_dir_createunique(tmp); - if (ret != ISC_R_SUCCESS) { - t_info("isc_dir_createunique failed %s\n", - isc_result_totext(ret)); - ++*nprobs; - goto cleanup; - } - - ret = dst_key_tofile(key1, type, tmp); - if (ret != 0) { - t_info("dst_key_tofile(%d) returned: %s\n", - alg, dst_result_totext(ret)); - ++*nfails; - goto cleanup; - } - - ret = dst_key_tofile(key2, type, tmp); - if (ret != 0) { - t_info("dst_key_tofile(%d) returned: %s\n", - alg, dst_result_totext(ret)); - ++*nfails; - goto cleanup; - } - - cleandir(tmp); - - isc_buffer_init(&b1, array1, sizeof(array1)); - ret = dst_key_computesecret(key1, key2, &b1); - if (ret != 0) { - t_info("dst_computesecret() returned: %s\n", - dst_result_totext(ret)); - ++*nfails; - goto cleanup; - } - - isc_buffer_init(&b2, array2, sizeof(array2)); - ret = dst_key_computesecret(key2, key1, &b2); - if (ret != 0) { - t_info("dst_computesecret() returned: %s\n", - dst_result_totext(ret)); - ++*nfails; - goto cleanup; - } - - isc_buffer_usedregion(&b1, &r1); - isc_buffer_usedregion(&b2, &r2); - if (r1.length != r2.length || memcmp(r1.base, r2.base, r1.length) != 0) - { - t_info("computed secrets don't match\n"); - ++*nfails; - goto cleanup; - } - - cleanup: - if (key1 != NULL) - dst_key_free(&key1); - if (key2 != NULL) - dst_key_free(&key2); -} - -static void -io(dns_name_t *name, isc_uint16_t id, isc_uint16_t alg, int type, - isc_mem_t *mctx, isc_result_t exp_result, int *nfails, int *nprobs) -{ - dst_key_t *key = NULL; - isc_result_t ret; - char current[PATH_MAX + 1]; - char tmp[PATH_MAX + 1]; - char *p; - - p = getcwd(current, PATH_MAX);; - if (p == NULL) { - t_info("getcwd failed %d\n", errno); - ++*nprobs; - goto failure; - } - - ret = dst_key_fromfile(name, id, alg, type, current, mctx, &key); - if (ret != ISC_R_SUCCESS) { - t_info("dst_key_fromfile(%d) returned: %s\n", - alg, dst_result_totext(ret)); - ++*nfails; - goto failure; - } - - if (dst_key_id(key) != id) { - t_info("key ID incorrect\n"); - ++*nfails; - goto failure; - } - - if (dst_key_alg(key) != alg) { - t_info("key algorithm incorrect\n"); - ++*nfails; - goto failure; - } - - if (dst_key_getttl(key) != 0) { - t_info("initial key TTL incorrect\n"); - ++*nfails; - goto failure; - } - -#ifndef WIN32 - ret = isc_file_mktemplate("/tmp/", tmp, sizeof(tmp)); -#else - ret = isc_file_mktemplate(getenv("TEMP"), tmp, sizeof(tmp)); -#endif - if (ret != ISC_R_SUCCESS) { - t_info("isc_file_mktemplate failed %s\n", - isc_result_totext(ret)); - ++*nprobs; - goto failure; - } - - ret = isc_dir_createunique(tmp); - if (ret != ISC_R_SUCCESS) { - t_info("mkdir failed %d\n", errno); - ++*nprobs; - goto failure; - } - - ret = dst_key_tofile(key, type, tmp); - if (ret != 0) { - t_info("dst_key_tofile(%d) returned: %s\n", - alg, dst_result_totext(ret)); - ++*nfails; - goto failure; - } - - if (dst_key_alg(key) != DST_ALG_DH) - use(key, mctx, exp_result, nfails); - - /* - * Skip the rest of this test if we weren't expecting - * the read to be successful. - */ - if (exp_result != ISC_R_SUCCESS) - goto cleanup; - - dst_key_setttl(key, 3600); - ret = dst_key_tofile(key, type, tmp); - if (ret != 0) { - t_info("dst_key_tofile(%d) returned: %s\n", - alg, dst_result_totext(ret)); - ++*nfails; - goto failure; - } - - /* Reread key to confirm TTL was changed */ - dst_key_free(&key); - ret = dst_key_fromfile(name, id, alg, type, tmp, mctx, &key); - if (ret != ISC_R_SUCCESS) { - t_info("dst_key_fromfile(%d) returned: %s\n", - alg, dst_result_totext(ret)); - ++*nfails; - goto failure; - } - - if (dst_key_getttl(key) != 3600) { - t_info("modified key TTL incorrect\n"); - ++*nfails; - goto failure; - } - - cleanup: - cleandir(tmp); - - failure: - if (key != NULL) - dst_key_free(&key); -} - -static void -generate(int alg, isc_mem_t *mctx, int size, int *nfails) { - isc_result_t ret; - dst_key_t *key = NULL; - - ret = dst_key_generate(dns_rootname, alg, size, 0, 0, 0, - dns_rdataclass_in, mctx, &key); - if (ret != ISC_R_SUCCESS) { - t_info("dst_key_generate(%d) returned: %s\n", alg, - dst_result_totext(ret)); - ++*nfails; - goto cleanup; - } - - if (alg != DST_ALG_DH) - use(key, mctx, ISC_R_SUCCESS, nfails); - cleanup: - if (key != NULL) - dst_key_free(&key); -} - -#define DBUFSIZ 25 - -static const char *a1 = - "the dst module provides the capability to " - "generate, store and retrieve public and private keys, " - "sign and verify data using the RSA, DSA and MD5 algorithms, " - "and compute Diffie-Hellman shared secrets."; -static void -t1(void) { - isc_mem_t *mctx; - isc_entropy_t *ectx; - int nfails; - int nprobs; - int result; - isc_result_t isc_result; - dns_fixedname_t fname; - dns_name_t *name; - isc_buffer_t b; - - t_assert("dst", 1, T_REQUIRED, "%s", a1); - - nfails = 0; - nprobs = 0; - mctx = NULL; - isc_result = isc_mem_create(0, 0, &mctx); - if (isc_result != ISC_R_SUCCESS) { - t_info("isc_mem_create failed %s\n", - isc_result_totext(isc_result)); - t_result(T_UNRESOLVED); - return; - } - ectx = NULL; - isc_result = isc_entropy_create(mctx, &ectx); - if (isc_result != ISC_R_SUCCESS) { - t_info("isc_entropy_create failed %s\n", - isc_result_totext(isc_result)); - t_result(T_UNRESOLVED); - return; - } - isc_result = isc_entropy_createfilesource(ectx, "randomfile"); - if (isc_result != ISC_R_SUCCESS) { - t_info("isc_entropy_create failed %s\n", - isc_result_totext(isc_result)); - t_result(T_UNRESOLVED); - return; - } - isc_result = dst_lib_init(mctx, ectx, ISC_ENTROPY_BLOCKING); - if (isc_result != ISC_R_SUCCESS) { - t_info("dst_lib_init failed %s\n", - isc_result_totext(isc_result)); - t_result(T_UNRESOLVED); - return; - } - - if (!dst_algorithm_supported(DST_ALG_RSAMD5)) { - dst_lib_destroy(); - t_info("library built without crypto support\n"); - t_result(T_SKIPPED); - return; - } - - t_info("testing use of stored keys [1]\n"); - - dns_fixedname_init(&fname); - name = dns_fixedname_name(&fname); - isc_buffer_constinit(&b, "test.", 5); - isc_buffer_add(&b, 5); - isc_result = dns_name_fromtext(name, &b, NULL, 0, NULL); - if (isc_result != ISC_R_SUCCESS) { - t_info("dns_name_fromtext failed %s\n", - isc_result_totext(isc_result)); - t_result(T_UNRESOLVED); - return; - } - io(name, 23616, DST_ALG_DSA, DST_TYPE_PRIVATE|DST_TYPE_PUBLIC, - mctx, ISC_R_SUCCESS, &nfails, &nprobs); - t_info("testing use of stored keys [2]\n"); - io(name, 54622, DST_ALG_RSAMD5, DST_TYPE_PRIVATE|DST_TYPE_PUBLIC, - mctx, ISC_R_SUCCESS, &nfails, &nprobs); - - t_info("testing use of stored keys [3]\n"); - io(name, 49667, DST_ALG_DSA, DST_TYPE_PRIVATE|DST_TYPE_PUBLIC, - mctx, DST_R_NULLKEY, &nfails, &nprobs); - t_info("testing use of stored keys [4]\n"); - io(name, 2, DST_ALG_RSAMD5, DST_TYPE_PRIVATE|DST_TYPE_PUBLIC, - mctx, DST_R_NULLKEY, &nfails, &nprobs); - - isc_buffer_constinit(&b, "dh.", 3); - isc_buffer_add(&b, 3); - isc_result = dns_name_fromtext(name, &b, NULL, 0, NULL); - if (isc_result != ISC_R_SUCCESS) { - t_info("dns_name_fromtext failed %s\n", - isc_result_totext(isc_result)); - t_result(T_UNRESOLVED); - return; - } - - dh(name, 18602, name, 48957, mctx, ISC_R_SUCCESS, &nfails, &nprobs); - - t_info("testing use of generated keys\n"); - generate(DST_ALG_RSAMD5, mctx, 512, &nfails); - generate(DST_ALG_DSA, mctx, 512, &nfails); - generate(DST_ALG_DH, mctx, 512, &nfails); - /* - * This one uses a constant. - */ - generate(DST_ALG_DH, mctx, 768, &nfails); - generate(DST_ALG_HMACMD5, mctx, 512, &nfails); - - dst_lib_destroy(); - - isc_entropy_detach(&ectx); - - isc_mem_destroy(&mctx); - - result = T_UNRESOLVED; - if ((nfails == 0) && (nprobs == 0)) - result = T_PASS; - else if (nfails) - result = T_FAIL; - t_result(result); - -} - -#define T_SIGMAX 512 - -#undef NEWSIG /* Define NEWSIG to generate the original signature file. */ - -#ifdef NEWSIG - -/* - * Write a sig in buf to file at path. - */ -static int -sig_tofile(char *path, isc_buffer_t *buf) { - int rval; - int fd; - int len; - int nprobs; - int cnt; - unsigned char c; - unsigned char val; - - cnt = 0; - nprobs = 0; - len = buf->used - buf->current; - - t_info("buf: current %d used %d len %d\n", - buf->current, buf->used, len); - - fd = open(path, O_CREAT|O_TRUNC|O_WRONLY, S_IRWXU|S_IRWXO|S_IRWXG); - if (fd < 0) { - t_info("open %s failed %d\n", path, errno); - return(1); - } - - while (len) { - c = (unsigned char) isc_buffer_getuint8(buf); - val = ((c >> 4 ) & 0x0f); - if ((0 <= val) && (val <= 9)) - val = '0' + val; - else - val = 'A' + val - 10; - rval = write(fd, &val, 1); - if (rval != 1) { - ++nprobs; - t_info("write failed %d %d\n", rval, errno); - break; - } - val = (c & 0x0f); - if ((0 <= val) && (val <= 9)) - val = '0' + val; - else - val = 'A' + val - 10; - rval = write(fd, &val, 1); - if (rval != 1) { - ++nprobs; - t_info("write failed %d %d\n", rval, errno); - break; - } - --len; - ++cnt; - if ((cnt % 16) == 0) { - val = '\n'; - rval = write(fd, &val, 1); - if (rval != 1) { - ++nprobs; - t_info("write failed %d %d\n", rval, errno); - break; - } - } - } - val = '\n'; - rval = write(fd, &val, 1); - if (rval != 1) { - ++nprobs; - t_info("write failed %d %d\n", rval, errno); - } - (void) close(fd); - return(nprobs); -} - -#endif /* NEWSIG */ - -/* - * Read sig in file at path to buf. - */ -static int -sig_fromfile(char *path, isc_buffer_t *iscbuf) { - size_t rval; - size_t len; - FILE *fp; - unsigned char val; - char *p; - char *buf; - isc_result_t isc_result; - off_t size; - - isc_result = isc_stdio_open(path, "rb", &fp); - if (isc_result != ISC_R_SUCCESS) { - t_info("open failed, result: %s\n", - isc_result_totext(isc_result)); - return(1); - } - - isc_result = isc_file_getsizefd(fileno(fp), &size); - if (isc_result != ISC_R_SUCCESS) { - t_info("stat %s failed, result: %s\n", - path, isc_result_totext(isc_result)); - isc_stdio_close(fp); - return(1); - } - - buf = (char *) malloc((size + 1) * sizeof(char)); - if (buf == NULL) { - t_info("malloc failed, errno == %d\n", errno); - isc_stdio_close(fp); - return(1); - } - - len = (size_t)size; - p = buf; - while (len != 0U) { - isc_result = isc_stdio_read(p, 1, len, fp, &rval); - if (isc_result == ISC_R_SUCCESS) { - len -= rval; - p += rval; - } else { - t_info("read failed %d, result: %s\n", - (int)rval, isc_result_totext(isc_result)); - (void) free(buf); - (void) isc_stdio_close(fp); - return(1); - } - } - isc_stdio_close(fp); - - p = buf; - len = size; - while (len > 0U) { - if ((*p == '\r') || (*p == '\n')) { - ++p; - --len; - continue; - } else if (len < 2U) - goto err; - if (('0' <= *p) && (*p <= '9')) - val = *p - '0'; - else if (('A' <= *p) && (*p <= 'F')) - val = *p - 'A' + 10; - else - goto err; - ++p; - val <<= 4; - --len; - if (('0' <= *p) && (*p <= '9')) - val |= (*p - '0'); - else if (('A' <= *p) && (*p <= 'F')) - val |= (*p - 'A' + 10); - else - goto err; - ++p; - --len; - isc_buffer_putuint8(iscbuf, val); - } - (void) free(buf); - return(0); - - err: - (void) free(buf); - return (1); -} - -static void -t2_sigchk(char *datapath, char *sigpath, char *keyname, - int id, int alg, int type, - isc_mem_t *mctx, char *expected_result, - int *nfails, int *nprobs) -{ - size_t rval; - size_t len; - FILE *fp; - int exp_res; - dst_key_t *key = NULL; - unsigned char sig[T_SIGMAX]; - unsigned char *p; - unsigned char *data; - off_t size; - isc_result_t isc_result; - isc_buffer_t databuf; - isc_buffer_t sigbuf; - isc_region_t datareg; - isc_region_t sigreg; - dns_fixedname_t fname; - dns_name_t *name; - isc_buffer_t b; - dst_context_t *ctx = NULL; - - /* - * Read data from file in a form usable by dst_verify. - */ - isc_result = isc_stdio_open(datapath, "rb", &fp); - if (isc_result != ISC_R_SUCCESS) { - t_info("t2_sigchk: open failed %s\n", - isc_result_totext(isc_result)); - ++*nprobs; - return; - } - - isc_result = isc_file_getsizefd(fileno(fp), &size); - if (isc_result != ISC_R_SUCCESS) { - t_info("t2_sigchk: stat (%s) failed %s\n", - datapath, isc_result_totext(isc_result)); - ++*nprobs; - isc_stdio_close(fp); - return; - } - - data = (unsigned char *) malloc(size * sizeof(unsigned char)); - if (data == NULL) { - t_info("t2_sigchk: malloc failed %d\n", errno); - ++*nprobs; - isc_stdio_close(fp); - return; - } - - p = data; - len = (size_t)size; - do { - isc_result = isc_stdio_read(p, 1, len, fp, &rval); - if (isc_result == ISC_R_SUCCESS) { - len -= rval; - p += rval; - } - } while (len); - (void) isc_stdio_close(fp); - - /* - * Read key from file in a form usable by dst_verify. - */ - dns_fixedname_init(&fname); - name = dns_fixedname_name(&fname); - isc_buffer_constinit(&b, keyname, strlen(keyname)); - isc_buffer_add(&b, strlen(keyname)); - isc_result = dns_name_fromtext(name, &b, dns_rootname, 0, NULL); - if (isc_result != ISC_R_SUCCESS) { - t_info("dns_name_fromtext failed %s\n", - isc_result_totext(isc_result)); - (void) free(data); - ++*nprobs; - return; - } - isc_result = dst_key_fromfile(name, id, alg, type, NULL, mctx, &key); - if (isc_result != ISC_R_SUCCESS) { - t_info("dst_key_fromfile failed %s\n", - isc_result_totext(isc_result)); - (void) free(data); - ++*nprobs; - return; - } - - isc_buffer_init(&databuf, data, (unsigned int)size); - isc_buffer_add(&databuf, (unsigned int)size); - isc_buffer_usedregion(&databuf, &datareg); - -#ifdef NEWSIG - - /* - * If we're generating a signature for the first time, - * sign the data and save the signature to a file - */ - - memset(sig, 0, sizeof(sig)); - isc_buffer_init(&sigbuf, sig, sizeof(sig)); - - isc_result = dst_context_create3(key, mctx, - DNS_LOGCATEGORY_GENERAL, - ISC_TRUE, &ctx); - if (isc_result != ISC_R_SUCCESS) { - t_info("dst_context_create(%d) failed %s\n", - dst_result_totext(isc_result)); - (void) free(data); - dst_key_free(&key); - ++*nprobs; - return; - } - isc_result = dst_context_adddata(ctx, &datareg); - if (isc_result != ISC_R_SUCCESS) { - t_info("dst_context_adddata(%d) failed %s\n", - dst_result_totext(isc_result)); - (void) free(data); - dst_key_free(&key); - dst_context_destroy(&ctx); - ++*nprobs; - return; - } - isc_result = dst_context_sign(ctx, &sigbuf); - if (isc_result != ISC_R_SUCCESS) { - t_info("dst_sign(%d) failed %s\n", - dst_result_totext(isc_result)); - (void) free(data); - dst_key_free(&key); - dst_context_destroy(&ctx); - ++*nprobs; - return; - } - dst_context_destroy(&ctx); - - rval = sig_tofile(sigpath, &sigbuf); - if (rval != 0) { - t_info("sig_tofile failed\n"); - ++*nprobs; - (void) free(data); - dst_key_free(&key); - return; - } - -#endif /* NEWSIG */ - - memset(sig, 0, sizeof(sig)); - isc_buffer_init(&sigbuf, sig, sizeof(sig)); - - /* - * Read precomputed signature from file in a form usable by dst_verify. - */ - rval = sig_fromfile(sigpath, &sigbuf); - if (rval != 0U) { - t_info("sig_fromfile failed\n"); - (void) free(data); - dst_key_free(&key); - ++*nprobs; - return; - } - - /* - * Verify that the key signed the data. - */ - isc_buffer_remainingregion(&sigbuf, &sigreg); - - exp_res = 0; - if (strstr(expected_result, "!")) - exp_res = 1; - - isc_result = dst_context_create3(key, mctx, - DNS_LOGCATEGORY_GENERAL, - ISC_FALSE, &ctx); - if (isc_result != ISC_R_SUCCESS) { - t_info("dst_context_create returned %s\n", - isc_result_totext(isc_result)); - (void) free(data); - dst_key_free(&key); - ++*nfails; - return; - } - isc_result = dst_context_adddata(ctx, &datareg); - if (isc_result != ISC_R_SUCCESS) { - t_info("dst_context_adddata returned %s\n", - isc_result_totext(isc_result)); - (void) free(data); - dst_context_destroy(&ctx); - dst_key_free(&key); - ++*nfails; - return; - } - isc_result = dst_context_verify(ctx, &sigreg); - if ( ((exp_res == 0) && (isc_result != ISC_R_SUCCESS)) || - ((exp_res != 0) && (isc_result == ISC_R_SUCCESS))) { - - t_info("dst_context_verify returned %s, expected %s\n", - isc_result_totext(isc_result), - expected_result); - ++*nfails; - } - - (void) free(data); - dst_context_destroy(&ctx); - dst_key_free(&key); - return; -} - -/* - * The astute observer will note that t1() signs then verifies data - * during the test but that t2() verifies data that has been - * signed at some earlier time, possibly with an entire different - * version or implementation of the DSA and RSA algorithms - */ - -isc_mem_t *t2_mctx = NULL; -isc_entropy_t *t2_ectx = NULL; - -static int -t2_vfy_init(void) { - isc_result_t isc_result; - - t2_mctx = NULL; - isc_result = isc_mem_create(0, 0, &t2_mctx); - if (isc_result != ISC_R_SUCCESS) { - t_info("isc_mem_create failed %s\n", - isc_result_totext(isc_result)); - return(0); - } - t2_ectx = NULL; - isc_result = isc_entropy_create(t2_mctx, &t2_ectx); - if (isc_result != ISC_R_SUCCESS) { - t_info("isc_entropy_create failed %s\n", - isc_result_totext(isc_result)); - return(0); - } - isc_result = isc_entropy_createfilesource(t2_ectx, "randomfile"); - if (isc_result != ISC_R_SUCCESS) { - t_info("isc_entropy_create failed %s\n", - isc_result_totext(isc_result)); - return(0); - } - isc_result = dst_lib_init(t2_mctx, t2_ectx, ISC_ENTROPY_BLOCKING); - if (isc_result != ISC_R_SUCCESS) { - t_info("dst_lib_init failed %s\n", - isc_result_totext(isc_result)); - return(0); - } - return(1); -} - -/* - * av == datafile, sigpath, keyname, keyid, alg, exp_result. - */ -static int -t2_vfy(char **av) { - char *datapath; - char *sigpath; - char *keyname; - char *key; - int keyid; - char *alg; - int algid; - char *exp_result; - int nfails; - int nprobs; - int result; - - datapath = *av++; - sigpath = *av++; - keyname = *av++; - key = *av++; - keyid = atoi(key); - alg = *av++; - exp_result = *av++; - nfails = 0; - nprobs = 0; - - if (! strcasecmp(alg, "DST_ALG_DSA")) - algid = DST_ALG_DSA; - else if (! strcasecmp(alg, "DST_ALG_RSAMD5")) - algid = DST_ALG_RSAMD5; - else { - t_info("Unknown algorithm %s\n", alg); - return(T_UNRESOLVED); - } - - if (!dst_algorithm_supported(DST_ALG_RSAMD5)) { - t_info("library built without crypto support\n"); - return (T_SKIPPED); - } - - t_info("testing %s, %s, %s, %s, %s, %s\n", - datapath, sigpath, keyname, key, alg, exp_result); - t2_sigchk(datapath, sigpath, keyname, keyid, - algid, DST_TYPE_PRIVATE|DST_TYPE_PUBLIC, - t2_mctx, exp_result, - &nfails, &nprobs); - - result = T_UNRESOLVED; - if (nfails) - result = T_FAIL; - else if ((nfails == 0) && (nprobs == 0)) - result = T_PASS; - - return(result); -} - -static const char *a2 = - "the dst module provides the capability to " - "verify data signed with the RSA and DSA algorithms"; - -static void -t2(void) { - int result; - t_assert("dst", 2, T_REQUIRED, "%s", a2); - if (!t2_vfy_init()) { - result = T_UNRESOLVED; - } else { - result = t_eval("dst_2_data", t2_vfy, 6); - dst_lib_destroy(); - } - if (t2_ectx) - isc_entropy_detach(&t2_ectx); - if (t2_mctx) - isc_mem_destroy(&t2_mctx); - t_result(result); -} - -testspec_t T_testlist[] = { - { (PFV) t1, "basic dst module verification" }, - { (PFV) t2, "signature ineffability" }, - { (PFV) 0, NULL } -}; - -#ifdef WIN32 -int -main(int argc, char **argv) { - t_settests(T_testlist); - return (t_main(argc, argv)); -} -#endif diff --git a/bin/tests/dst/win32/REQUIRE_EXTENDED_DIR b/bin/tests/dst/win32/REQUIRE_EXTENDED_DIR deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/bin/tests/dst/win32/t_dst.vcxproj.filters.in b/bin/tests/dst/win32/t_dst.vcxproj.filters.in deleted file mode 100644 index d49779dbd63..00000000000 --- a/bin/tests/dst/win32/t_dst.vcxproj.filters.in +++ /dev/null @@ -1,22 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hpp;hxx;hm;inl;inc;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - - - - - Source Files - - - \ No newline at end of file diff --git a/bin/tests/dst/win32/t_dst.vcxproj.in b/bin/tests/dst/win32/t_dst.vcxproj.in deleted file mode 100644 index a1aeb00dd86..00000000000 --- a/bin/tests/dst/win32/t_dst.vcxproj.in +++ /dev/null @@ -1,148 +0,0 @@ - - - - - Debug - @PLATFORM@ - - - Release - @PLATFORM@ - - - - {EE9B94CF-7C33-4F3B-A674-FB756D422C54} - Win32Proj - t_dst - - - - Application - true - MultiByte - - - Application - false - true - MultiByte - - - - - - - - - - - - - true - ..\..\..\..\Build\$(Configuration)\ - .\$(Configuration)\ - - - false - ..\..\..\..\Build\$(Configuration)\ - .\$(Configuration)\ - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - .\$(Configuration)\$(TargetName).pch - .\$(Configuration)\ - .\$(Configuration)\ - $(OutDir)$(TargetName).pdb - true - .\;..\..\..\..\;@LIBXML2_INC@..\..\..\..\lib\isc\win32;..\..\..\..\lib\isc\win32\include;..\..\..\..\lib\isc\include;..\..\..\..\lib\dns\include;..\..\..\..\lib\tests\include;%(AdditionalIncludeDirectories) - CompileAsC - - - Console - true - ..\..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt) - ..\..\..\..\lib\isc\win32\$(Configuration);..\..\..\..\lib\dns\win32\$(Configuration);..\..\..\..\lib\tests\win32\$(Configuration);%(AdditionalLibraryDirectories) - @LIBXML2_LIB@libisc.lib;libdns.lib;libtests.lib;ws2_32.lib;%(AdditionalDependencies) - - - cd .. -copy "Kdh.+002+18602.key.in" "Kdh.+002+18602.key" -copy "Kdh.+002+18602.private.in" "Kdh.+002+18602.private" -copy "Kdh.+002+48957.key.in" "Kdh.+002+48957.key" -copy "Kdh.+002+48957.private.in" "Kdh.+002+48957.private" -copy "Ktest.+001+00002.key.in" "Ktest.+001+00002.key" -copy "Ktest.+001+54622.key.in" "Ktest.+001+54622.key" -copy "Ktest.+001+54622.private.in" "Ktest.+001+54622.private" -copy "Ktest.+003+23616.key.in" "Ktest.+003+23616.key" -copy "Ktest.+003+23616.private.in" "Ktest.+003+23616.private" -copy "Ktest.+003+49667.key.in" "Ktest.+003+49667.key" -copy dst_2_data.in dst_2_data -copy t2_data_1.in t2_data_1 -copy t2_data_2.in t2_data_2 -copy t2_dsasig.in t2_dsasig -copy t2_rsasig.in t2_rsasig - - - - - - Level3 - - - MaxSpeed - true - @INTRINSIC@ - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - OnlyExplicitInline - false - true - .\$(Configuration)\$(TargetName).pch - .\$(Configuration)\ - .\$(Configuration)\ - $(OutDir)$(TargetName).pdb - .\;..\..\..\..\;@LIBXML2_INC@..\..\..\..\lib\isc\win32;..\..\..\..\lib\isc\win32\include;..\..\..\..\lib\isc\include;..\..\..\..\lib\dns\include;..\..\..\..\lib\tests\include;%(AdditionalIncludeDirectories) - CompileAsC - - - Console - false - true - true - ..\..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt) - Default - ..\..\..\..\lib\isc\win32\$(Configuration);..\..\..\..\lib\dns\win32\$(Configuration);..\..\..\..\lib\tests\win32\$(Configuration);%(AdditionalLibraryDirectories) - @LIBXML2_LIB@libisc.lib;libdns.lib;libtests.lib;ws2_32.lib;%(AdditionalDependencies) - - - cd .. -copy "Kdh.+002+18602.key.in" "Kdh.+002+18602.key" -copy "Kdh.+002+18602.private.in" "Kdh.+002+18602.private" -copy "Kdh.+002+48957.key.in" "Kdh.+002+48957.key" -copy "Kdh.+002+48957.private.in" "Kdh.+002+48957.private" -copy "Ktest.+001+00002.key.in" "Ktest.+001+00002.key" -copy "Ktest.+001+54622.key.in" "Ktest.+001+54622.key" -copy "Ktest.+001+54622.private.in" "Ktest.+001+54622.private" -copy "Ktest.+003+23616.key.in" "Ktest.+003+23616.key" -copy "Ktest.+003+23616.private.in" "Ktest.+003+23616.private" -copy "Ktest.+003+49667.key.in" "Ktest.+003+49667.key" -copy dst_2_data.in dst_2_data -copy t2_data_1.in t2_data_1 -copy t2_data_2.in t2_data_2 -copy t2_dsasig.in t2_dsasig -copy t2_rsasig.in t2_rsasig - - - - - - - - - - diff --git a/bin/tests/dst/win32/t_dst.vcxproj.user b/bin/tests/dst/win32/t_dst.vcxproj.user deleted file mode 100644 index 695b5c78b91..00000000000 --- a/bin/tests/dst/win32/t_dst.vcxproj.user +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/configure b/configure index 358cbd581fb..1345d1ae829 100755 --- a/configure +++ b/configure @@ -24157,7 +24157,7 @@ ac_config_commands="$ac_config_commands chmod" # elsewhere if there's a good reason for doing so. # -ac_config_files="$ac_config_files make/Makefile make/mkdep Makefile bin/Makefile bin/check/Makefile bin/confgen/Makefile bin/confgen/unix/Makefile bin/delv/Makefile bin/dig/Makefile bin/dnssec/Makefile bin/named/Makefile bin/named/unix/Makefile bin/nsupdate/Makefile bin/pkcs11/Makefile bin/python/Makefile bin/python/isc/Makefile bin/python/isc/utils.py bin/python/isc/tests/Makefile bin/python/dnssec-checkds.py bin/python/dnssec-coverage.py bin/python/dnssec-keymgr.py bin/python/isc/__init__.py bin/python/isc/checkds.py bin/python/isc/coverage.py bin/python/isc/dnskey.py bin/python/isc/eventlist.py bin/python/isc/keydict.py bin/python/isc/keyevent.py bin/python/isc/keymgr.py bin/python/isc/keyseries.py bin/python/isc/keyzone.py bin/python/isc/policy.py bin/python/isc/rndc.py bin/python/isc/tests/dnskey_test.py bin/python/isc/tests/policy_test.py bin/rndc/Makefile bin/tests/Makefile bin/tests/dst/Makefile bin/tests/dst/Kdh.+002+18602.key bin/tests/dst/Kdh.+002+18602.private bin/tests/dst/Kdh.+002+48957.key bin/tests/dst/Kdh.+002+48957.private bin/tests/dst/Ktest.+001+00002.key bin/tests/dst/Ktest.+001+54622.key bin/tests/dst/Ktest.+001+54622.private bin/tests/dst/Ktest.+003+23616.key bin/tests/dst/Ktest.+003+23616.private bin/tests/dst/Ktest.+003+49667.key bin/tests/dst/dst_2_data bin/tests/dst/t2_data_1 bin/tests/dst/t2_data_2 bin/tests/dst/t2_dsasig bin/tests/dst/t2_rsasig bin/tests/headerdep_test.sh bin/tests/optional/Makefile bin/tests/pkcs11/Makefile bin/tests/pkcs11/benchmarks/Makefile bin/tests/system/Makefile bin/tests/system/conf.sh bin/tests/system/dlz/prereq.sh bin/tests/system/dlzexternal/Makefile bin/tests/system/dlzexternal/ns1/dlzs.conf bin/tests/system/dyndb/Makefile bin/tests/system/dyndb/driver/Makefile bin/tests/system/inline/checkdsa.sh bin/tests/system/pipelined/Makefile bin/tests/system/rndc/Makefile bin/tests/system/rpz/Makefile bin/tests/system/rsabigexponent/Makefile bin/tests/system/tkey/Makefile bin/tests/virtual-time/Makefile bin/tests/virtual-time/conf.sh bin/tools/Makefile contrib/scripts/check-secure-delegation.pl contrib/scripts/zone-edit.sh doc/Makefile doc/arm/Makefile doc/arm/noteversion.xml doc/arm/pkgversion.xml doc/arm/releaseinfo.xml doc/doxygen/Doxyfile doc/doxygen/Makefile doc/doxygen/doxygen-input-filter doc/misc/Makefile doc/tex/Makefile doc/tex/armstyle.sty doc/xsl/Makefile doc/xsl/isc-docbook-chunk.xsl doc/xsl/isc-docbook-html.xsl doc/xsl/isc-manpage.xsl doc/xsl/isc-notes-html.xsl isc-config.sh lib/Makefile lib/bind9/Makefile lib/bind9/include/Makefile lib/bind9/include/bind9/Makefile lib/dns/Makefile lib/dns/include/Makefile lib/dns/include/dns/Makefile lib/dns/include/dst/Makefile lib/dns/tests/Makefile lib/irs/Makefile lib/irs/include/Makefile lib/irs/include/irs/Makefile lib/irs/include/irs/netdb.h lib/irs/include/irs/platform.h lib/irs/tests/Makefile lib/isc/$arch/Makefile lib/isc/$arch/include/Makefile lib/isc/$arch/include/isc/Makefile lib/isc/$thread_dir/Makefile lib/isc/$thread_dir/include/Makefile lib/isc/$thread_dir/include/isc/Makefile lib/isc/Makefile lib/isc/include/Makefile lib/isc/include/isc/Makefile lib/isc/include/isc/platform.h lib/isc/include/pk11/Makefile lib/isc/include/pkcs11/Makefile lib/isc/tests/Makefile lib/isc/nls/Makefile lib/isc/unix/Makefile lib/isc/unix/include/Makefile lib/isc/unix/include/isc/Makefile lib/isc/unix/include/pkcs11/Makefile lib/isccc/Makefile lib/isccc/include/Makefile lib/isccc/include/isccc/Makefile lib/isccfg/Makefile lib/isccfg/include/Makefile lib/isccfg/include/isccfg/Makefile lib/isccfg/tests/Makefile lib/ns/Makefile lib/ns/include/Makefile lib/ns/include/ns/Makefile lib/ns/tests/Makefile lib/tests/Makefile lib/tests/include/Makefile lib/tests/include/tests/Makefile lib/samples/Makefile lib/samples/Makefile-postinstall unit/Makefile unit/unittest.sh" +ac_config_files="$ac_config_files make/Makefile make/mkdep Makefile bin/Makefile bin/check/Makefile bin/confgen/Makefile bin/confgen/unix/Makefile bin/delv/Makefile bin/dig/Makefile bin/dnssec/Makefile bin/named/Makefile bin/named/unix/Makefile bin/nsupdate/Makefile bin/pkcs11/Makefile bin/python/Makefile bin/python/isc/Makefile bin/python/isc/utils.py bin/python/isc/tests/Makefile bin/python/dnssec-checkds.py bin/python/dnssec-coverage.py bin/python/dnssec-keymgr.py bin/python/isc/__init__.py bin/python/isc/checkds.py bin/python/isc/coverage.py bin/python/isc/dnskey.py bin/python/isc/eventlist.py bin/python/isc/keydict.py bin/python/isc/keyevent.py bin/python/isc/keymgr.py bin/python/isc/keyseries.py bin/python/isc/keyzone.py bin/python/isc/policy.py bin/python/isc/rndc.py bin/python/isc/tests/dnskey_test.py bin/python/isc/tests/policy_test.py bin/rndc/Makefile bin/tests/Makefile bin/tests/headerdep_test.sh bin/tests/optional/Makefile bin/tests/pkcs11/Makefile bin/tests/pkcs11/benchmarks/Makefile bin/tests/system/Makefile bin/tests/system/conf.sh bin/tests/system/dlz/prereq.sh bin/tests/system/dlzexternal/Makefile bin/tests/system/dlzexternal/ns1/dlzs.conf bin/tests/system/dyndb/Makefile bin/tests/system/dyndb/driver/Makefile bin/tests/system/inline/checkdsa.sh bin/tests/system/pipelined/Makefile bin/tests/system/rndc/Makefile bin/tests/system/rpz/Makefile bin/tests/system/rsabigexponent/Makefile bin/tests/system/tkey/Makefile bin/tests/virtual-time/Makefile bin/tests/virtual-time/conf.sh bin/tools/Makefile contrib/scripts/check-secure-delegation.pl contrib/scripts/zone-edit.sh doc/Makefile doc/arm/Makefile doc/arm/noteversion.xml doc/arm/pkgversion.xml doc/arm/releaseinfo.xml doc/doxygen/Doxyfile doc/doxygen/Makefile doc/doxygen/doxygen-input-filter doc/misc/Makefile doc/tex/Makefile doc/tex/armstyle.sty doc/xsl/Makefile doc/xsl/isc-docbook-chunk.xsl doc/xsl/isc-docbook-html.xsl doc/xsl/isc-manpage.xsl doc/xsl/isc-notes-html.xsl isc-config.sh lib/Makefile lib/bind9/Makefile lib/bind9/include/Makefile lib/bind9/include/bind9/Makefile lib/dns/Makefile lib/dns/include/Makefile lib/dns/include/dns/Makefile lib/dns/include/dst/Makefile lib/dns/tests/Makefile lib/irs/Makefile lib/irs/include/Makefile lib/irs/include/irs/Makefile lib/irs/include/irs/netdb.h lib/irs/include/irs/platform.h lib/irs/tests/Makefile lib/isc/$arch/Makefile lib/isc/$arch/include/Makefile lib/isc/$arch/include/isc/Makefile lib/isc/$thread_dir/Makefile lib/isc/$thread_dir/include/Makefile lib/isc/$thread_dir/include/isc/Makefile lib/isc/Makefile lib/isc/include/Makefile lib/isc/include/isc/Makefile lib/isc/include/isc/platform.h lib/isc/include/pk11/Makefile lib/isc/include/pkcs11/Makefile lib/isc/tests/Makefile lib/isc/nls/Makefile lib/isc/unix/Makefile lib/isc/unix/include/Makefile lib/isc/unix/include/isc/Makefile lib/isc/unix/include/pkcs11/Makefile lib/isccc/Makefile lib/isccc/include/Makefile lib/isccc/include/isccc/Makefile lib/isccfg/Makefile lib/isccfg/include/Makefile lib/isccfg/include/isccfg/Makefile lib/isccfg/tests/Makefile lib/ns/Makefile lib/ns/include/Makefile lib/ns/include/ns/Makefile lib/ns/tests/Makefile lib/tests/Makefile lib/tests/include/Makefile lib/tests/include/tests/Makefile lib/samples/Makefile lib/samples/Makefile-postinstall unit/Makefile unit/unittest.sh" # @@ -25196,22 +25196,6 @@ do "bin/python/isc/tests/policy_test.py") CONFIG_FILES="$CONFIG_FILES bin/python/isc/tests/policy_test.py" ;; "bin/rndc/Makefile") CONFIG_FILES="$CONFIG_FILES bin/rndc/Makefile" ;; "bin/tests/Makefile") CONFIG_FILES="$CONFIG_FILES bin/tests/Makefile" ;; - "bin/tests/dst/Makefile") CONFIG_FILES="$CONFIG_FILES bin/tests/dst/Makefile" ;; - "bin/tests/dst/Kdh.+002+18602.key") CONFIG_FILES="$CONFIG_FILES bin/tests/dst/Kdh.+002+18602.key" ;; - "bin/tests/dst/Kdh.+002+18602.private") CONFIG_FILES="$CONFIG_FILES bin/tests/dst/Kdh.+002+18602.private" ;; - "bin/tests/dst/Kdh.+002+48957.key") CONFIG_FILES="$CONFIG_FILES bin/tests/dst/Kdh.+002+48957.key" ;; - "bin/tests/dst/Kdh.+002+48957.private") CONFIG_FILES="$CONFIG_FILES bin/tests/dst/Kdh.+002+48957.private" ;; - "bin/tests/dst/Ktest.+001+00002.key") CONFIG_FILES="$CONFIG_FILES bin/tests/dst/Ktest.+001+00002.key" ;; - "bin/tests/dst/Ktest.+001+54622.key") CONFIG_FILES="$CONFIG_FILES bin/tests/dst/Ktest.+001+54622.key" ;; - "bin/tests/dst/Ktest.+001+54622.private") CONFIG_FILES="$CONFIG_FILES bin/tests/dst/Ktest.+001+54622.private" ;; - "bin/tests/dst/Ktest.+003+23616.key") CONFIG_FILES="$CONFIG_FILES bin/tests/dst/Ktest.+003+23616.key" ;; - "bin/tests/dst/Ktest.+003+23616.private") CONFIG_FILES="$CONFIG_FILES bin/tests/dst/Ktest.+003+23616.private" ;; - "bin/tests/dst/Ktest.+003+49667.key") CONFIG_FILES="$CONFIG_FILES bin/tests/dst/Ktest.+003+49667.key" ;; - "bin/tests/dst/dst_2_data") CONFIG_FILES="$CONFIG_FILES bin/tests/dst/dst_2_data" ;; - "bin/tests/dst/t2_data_1") CONFIG_FILES="$CONFIG_FILES bin/tests/dst/t2_data_1" ;; - "bin/tests/dst/t2_data_2") CONFIG_FILES="$CONFIG_FILES bin/tests/dst/t2_data_2" ;; - "bin/tests/dst/t2_dsasig") CONFIG_FILES="$CONFIG_FILES bin/tests/dst/t2_dsasig" ;; - "bin/tests/dst/t2_rsasig") CONFIG_FILES="$CONFIG_FILES bin/tests/dst/t2_rsasig" ;; "bin/tests/headerdep_test.sh") CONFIG_FILES="$CONFIG_FILES bin/tests/headerdep_test.sh" ;; "bin/tests/optional/Makefile") CONFIG_FILES="$CONFIG_FILES bin/tests/optional/Makefile" ;; "bin/tests/pkcs11/Makefile") CONFIG_FILES="$CONFIG_FILES bin/tests/pkcs11/Makefile" ;; diff --git a/configure.in b/configure.in index 280584b6822..2382552f5ee 100644 --- a/configure.in +++ b/configure.in @@ -5313,22 +5313,6 @@ AC_CONFIG_FILES([ bin/python/isc/tests/policy_test.py bin/rndc/Makefile bin/tests/Makefile - bin/tests/dst/Makefile - bin/tests/dst/Kdh.+002+18602.key - bin/tests/dst/Kdh.+002+18602.private - bin/tests/dst/Kdh.+002+48957.key - bin/tests/dst/Kdh.+002+48957.private - bin/tests/dst/Ktest.+001+00002.key - bin/tests/dst/Ktest.+001+54622.key - bin/tests/dst/Ktest.+001+54622.private - bin/tests/dst/Ktest.+003+23616.key - bin/tests/dst/Ktest.+003+23616.private - bin/tests/dst/Ktest.+003+49667.key - bin/tests/dst/dst_2_data - bin/tests/dst/t2_data_1 - bin/tests/dst/t2_data_2 - bin/tests/dst/t2_dsasig - bin/tests/dst/t2_rsasig bin/tests/headerdep_test.sh bin/tests/optional/Makefile bin/tests/pkcs11/Makefile diff --git a/lib/dns/tests/Atffile b/lib/dns/tests/Atffile index f83af900512..e13b2dc3969 100644 --- a/lib/dns/tests/Atffile +++ b/lib/dns/tests/Atffile @@ -10,6 +10,7 @@ tp: dbversion_test tp: dh_test tp: dispatch_test tp: dnstap_test +tp: dst_test tp: dstrandom_test tp: geoip_test tp: gost_test diff --git a/lib/dns/tests/Makefile.in b/lib/dns/tests/Makefile.in index 425cc0e8b9b..cfc33a0766e 100644 --- a/lib/dns/tests/Makefile.in +++ b/lib/dns/tests/Makefile.in @@ -38,6 +38,7 @@ SRCS = acl_test.c \ dh_test.c \ dispatch_test.c \ dnstap_test.c \ + dst_test.c \ dnstest.c \ dstrandom_test.c \ geoip_test.c \ @@ -70,6 +71,7 @@ TARGETS = acl_test@EXEEXT@ \ dh_test@EXEEXT@ \ dispatch_test@EXEEXT@ \ dnstap_test@EXEEXT@ \ + dst_test@EXEEXT@ \ dstrandom_test@EXEEXT@ \ geoip_test@EXEEXT@ \ gost_test@EXEEXT@ \ @@ -134,6 +136,11 @@ dnstap_test@EXEEXT@: dnstap_test.@O@ dnstest.@O@ ${ISCDEPLIBS} ${DNSDEPLIBS} dnstap_test.@O@ dnstest.@O@ ${DNSLIBS} \ ${ISCLIBS} ${LIBS} +dst_test@EXEEXT@: dst_test.@O@ ${ISCDEPLIBS} ${DNSDEPLIBS} + ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ \ + dst_test.@O@ dnstest.@O@ ${DNSLIBS} \ + ${ISCLIBS} ${LIBS} + geoip_test@EXEEXT@: geoip_test.@O@ ${ISCDEPLIBS} ${DNSDEPLIBS} ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ \ geoip_test.@O@ dnstest.@O@ ${DNSLIBS} \ diff --git a/lib/dns/tests/dst_test.c b/lib/dns/tests/dst_test.c new file mode 100644 index 00000000000..284249b65fe --- /dev/null +++ b/lib/dns/tests/dst_test.c @@ -0,0 +1,263 @@ +/* + * Copyright (C) Internet Systems Consortium, Inc. ("ISC") + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * See the COPYRIGHT file distributed with this work for additional + * information regarding copyright ownership. + */ + +/* ! \file */ + +#include + +#include + +#include + +#include +#include +#include +#include + +#include +#include + +#include "../dst_internal.h" + +#include "dnstest.h" + +ATF_TC(sig); +ATF_TC_HEAD(sig, tc) { + atf_tc_set_md_var(tc, "descr", "signature ineffability"); +} + +/* + * Read sig in file at path to buf. + */ +static isc_result_t +sig_fromfile(const char *path, isc_buffer_t *buf) { + isc_result_t result; + size_t rval, len; + FILE *fp = NULL; + unsigned char val; + char *p, *data; + off_t size; + + result = isc_stdio_open(path, "rb", &fp); + ATF_REQUIRE_EQ(result, ISC_R_SUCCESS); + + result = isc_file_getsizefd(fileno(fp), &size); + ATF_REQUIRE_EQ(result, ISC_R_SUCCESS); + + data = isc_mem_get(mctx, (size + 1)); + ATF_REQUIRE(data != NULL); + + len = (size_t)size; + p = data; + while (len != 0U) { + result = isc_stdio_read(p, 1, len, fp, &rval); + ATF_REQUIRE_EQ(result, ISC_R_SUCCESS); + len -= rval; + p += rval; + } + isc_stdio_close(fp); + + p = data; + len = size; + while (len > 0U) { + if ((*p == '\r') || (*p == '\n')) { + ++p; + --len; + continue; + } else if (len < 2U) + goto err; + if (('0' <= *p) && (*p <= '9')) { + val = *p - '0'; + } else if (('A' <= *p) && (*p <= 'F')) { + val = *p - 'A' + 10; + } else { + result = ISC_R_BADHEX; + goto err; + } + ++p; + val <<= 4; + --len; + if (('0' <= *p) && (*p <= '9')) { + val |= (*p - '0'); + } else if (('A' <= *p) && (*p <= 'F')) { + val |= (*p - 'A' + 10); + } else { + result = ISC_R_BADHEX; + goto err; + } + ++p; + --len; + isc_buffer_putuint8(buf, val); + } + + result = ISC_R_SUCCESS; + + err: + isc_mem_put(mctx, data, size + 1); + return (result); +} + +static void +check_sig(const char *datapath, const char *sigpath, const char *keyname, + dns_keytag_t id, dns_secalg_t alg, int type, isc_boolean_t expect) +{ + isc_result_t result; + size_t rval, len; + FILE *fp; + dst_key_t *key = NULL; + unsigned char sig[512]; + unsigned char *p; + unsigned char *data; + off_t size; + isc_buffer_t b; + isc_buffer_t databuf, sigbuf; + isc_region_t datareg, sigreg; + dns_fixedname_t fname; + dns_name_t *name; + dst_context_t *ctx = NULL; + + /* + * Read data from file in a form usable by dst_verify. + */ + result = isc_stdio_open(datapath, "rb", &fp); + ATF_REQUIRE_EQ(result, ISC_R_SUCCESS); + + result = isc_file_getsizefd(fileno(fp), &size); + ATF_REQUIRE_EQ(result, ISC_R_SUCCESS); + + data = isc_mem_get(mctx, (size + 1)); + ATF_REQUIRE(data != NULL); + + p = data; + len = (size_t)size; + do { + result = isc_stdio_read(p, 1, len, fp, &rval); + ATF_REQUIRE_EQ(result, ISC_R_SUCCESS); + len -= rval; + p += rval; + } while (len); + isc_stdio_close(fp); + + /* + * Read key from file in a form usable by dst_verify. + */ + dns_fixedname_init(&fname); + name = dns_fixedname_name(&fname); + isc_buffer_constinit(&b, keyname, strlen(keyname)); + isc_buffer_add(&b, strlen(keyname)); + result = dns_name_fromtext(name, &b, dns_rootname, 0, NULL); + ATF_REQUIRE_EQ(result, ISC_R_SUCCESS); + result = dst_key_fromfile(name, id, alg, type, "testdata/dst", + mctx, &key); + ATF_REQUIRE_EQ(result, ISC_R_SUCCESS); + + isc_buffer_init(&databuf, data, (unsigned int)size); + isc_buffer_add(&databuf, (unsigned int)size); + isc_buffer_usedregion(&databuf, &datareg); + + memset(sig, 0, sizeof(sig)); + isc_buffer_init(&sigbuf, sig, sizeof(sig)); + + /* + * Read precomputed signature from file in a form usable by dst_verify. + */ + result = sig_fromfile(sigpath, &sigbuf); + ATF_REQUIRE_EQ(result, ISC_R_SUCCESS); + + /* + * Verify that the key signed the data. + */ + isc_buffer_remainingregion(&sigbuf, &sigreg); + + result = dst_context_create3(key, mctx, DNS_LOGCATEGORY_GENERAL, + ISC_FALSE, &ctx); + ATF_REQUIRE_EQ(result, ISC_R_SUCCESS); + + result = dst_context_adddata(ctx, &datareg); + ATF_REQUIRE_EQ(result, ISC_R_SUCCESS); + result = dst_context_verify(ctx, &sigreg); + + ATF_REQUIRE((expect && (result == ISC_R_SUCCESS)) || + (!expect && (result != ISC_R_SUCCESS))); + + + isc_mem_put(mctx, data, size + 1); + dst_context_destroy(&ctx); + dst_key_free(&key); + + return; +} + +ATF_TC_BODY(sig, tc) { + isc_result_t result; + + UNUSED(tc); + + result = dns_test_begin(NULL, ISC_FALSE); + ATF_REQUIRE_EQ(result, ISC_R_SUCCESS); + struct { + const char *datapath; + const char *sigpath; + const char *keyname; + dns_keytag_t keyid; + dns_secalg_t alg; + isc_boolean_t expect; + } testcases[] = { + { + "testdata/dst/test1.data", + "testdata/dst/test1.dsasig", + "test.", 23616, DST_ALG_DSA, ISC_TRUE + }, + { + "testdata/dst/test1.data", + "testdata/dst/test1.rsasig", + "test.", 54622, DST_ALG_RSAMD5, ISC_TRUE + }, + { + /* wrong sig */ + "testdata/dst/test1.data", + "testdata/dst/test1.dsasig", + "test.", 54622, DST_ALG_RSAMD5, ISC_FALSE + }, + { + /* wrong data */ + "testdata/dst/test2.data", + "testdata/dst/test1.dsasig", + "test.", 23616, DST_ALG_DSA, ISC_FALSE + }, + }; + unsigned int i; + + for (i = 0; i < (sizeof(testcases)/sizeof(testcases[0])); i++) { + if (!dst_algorithm_supported(testcases[i].alg)) { + continue; + } + + check_sig(testcases[i].datapath, + testcases[i].sigpath, + testcases[i].keyname, + testcases[i].keyid, + testcases[i].alg, + DST_TYPE_PRIVATE|DST_TYPE_PUBLIC, + testcases[i].expect); + } + + dns_test_end(); +} + +/* + * Main + */ +ATF_TP_ADD_TCS(tp) { + ATF_TP_ADD_TC(tp, sig); + + return (atf_no_error()); +} diff --git a/bin/tests/dst/Ktest.+001+00002.key.in b/lib/dns/tests/testdata/dst/Ktest.+001+00002.key similarity index 100% rename from bin/tests/dst/Ktest.+001+00002.key.in rename to lib/dns/tests/testdata/dst/Ktest.+001+00002.key diff --git a/bin/tests/dst/Ktest.+001+54622.key.in b/lib/dns/tests/testdata/dst/Ktest.+001+54622.key similarity index 100% rename from bin/tests/dst/Ktest.+001+54622.key.in rename to lib/dns/tests/testdata/dst/Ktest.+001+54622.key diff --git a/bin/tests/dst/Ktest.+001+54622.private.in b/lib/dns/tests/testdata/dst/Ktest.+001+54622.private similarity index 100% rename from bin/tests/dst/Ktest.+001+54622.private.in rename to lib/dns/tests/testdata/dst/Ktest.+001+54622.private diff --git a/bin/tests/dst/Ktest.+003+23616.key.in b/lib/dns/tests/testdata/dst/Ktest.+003+23616.key similarity index 100% rename from bin/tests/dst/Ktest.+003+23616.key.in rename to lib/dns/tests/testdata/dst/Ktest.+003+23616.key diff --git a/bin/tests/dst/Ktest.+003+23616.private.in b/lib/dns/tests/testdata/dst/Ktest.+003+23616.private similarity index 100% rename from bin/tests/dst/Ktest.+003+23616.private.in rename to lib/dns/tests/testdata/dst/Ktest.+003+23616.private diff --git a/bin/tests/dst/Ktest.+003+49667.key.in b/lib/dns/tests/testdata/dst/Ktest.+003+49667.key similarity index 100% rename from bin/tests/dst/Ktest.+003+49667.key.in rename to lib/dns/tests/testdata/dst/Ktest.+003+49667.key diff --git a/bin/tests/dst/t2_data_1.in b/lib/dns/tests/testdata/dst/test1.data similarity index 100% rename from bin/tests/dst/t2_data_1.in rename to lib/dns/tests/testdata/dst/test1.data diff --git a/bin/tests/dst/t2_dsasig.in b/lib/dns/tests/testdata/dst/test1.dsasig similarity index 100% rename from bin/tests/dst/t2_dsasig.in rename to lib/dns/tests/testdata/dst/test1.dsasig diff --git a/bin/tests/dst/t2_rsasig.in b/lib/dns/tests/testdata/dst/test1.rsasig similarity index 99% rename from bin/tests/dst/t2_rsasig.in rename to lib/dns/tests/testdata/dst/test1.rsasig index 5f59ef3701a..5ba62b4a142 100644 --- a/bin/tests/dst/t2_rsasig.in +++ b/lib/dns/tests/testdata/dst/test1.rsasig @@ -3,4 +3,3 @@ FF66AB866EF0BDB0F515001E234E699B F5CD6FB41FB15D4213705ABE9B563896 2196228648E0F8AA7F2F4EED3C19165C 1B4C70C9D69B93A1F2BE5B2F948CE023 - diff --git a/bin/tests/dst/t2_data_2.in b/lib/dns/tests/testdata/dst/test2.data similarity index 100% rename from bin/tests/dst/t2_data_2.in rename to lib/dns/tests/testdata/dst/test2.data diff --git a/util/copyrights b/util/copyrights index 5a9c2171678..1ac4e6038ff 100644 --- a/util/copyrights +++ b/util/copyrights @@ -344,33 +344,6 @@ ./bin/tests/byaddr_test.c C 2000,2001,2002,2004,2005,2007,2012,2015,2016,2018 ./bin/tests/byname_test.c C 2000,2001,2004,2005,2007,2009,2012,2015,2016,2017,2018 ./bin/tests/cfg_test.c C 2001,2002,2004,2005,2007,2009,2010,2011,2015,2016,2018 -./bin/tests/db_test.c C 1999,2000,2001,2004,2005,2007,2008,2009,2011,2012,2013,2015,2016,2017,2018 -./bin/tests/dst/.gitignore X 2012,2013,2018 -./bin/tests/dst/Kdh.+002+18602.key.in X 2001,2013,2018 -./bin/tests/dst/Kdh.+002+18602.private.in X 2001,2013,2018 -./bin/tests/dst/Kdh.+002+48957.key.in X 2001,2013,2018 -./bin/tests/dst/Kdh.+002+48957.private.in X 2001,2013,2018 -./bin/tests/dst/Ktest.+001+00002.key.in X 2001,2004,2013,2018 -./bin/tests/dst/Ktest.+001+54622.key.in X 1999,2000,2001,2004,2013,2018 -./bin/tests/dst/Ktest.+001+54622.private.in X 1999,2000,2001,2013,2018 -./bin/tests/dst/Ktest.+003+23616.key.in X 2001,2004,2013,2018 -./bin/tests/dst/Ktest.+003+23616.private.in X 2001,2013,2018 -./bin/tests/dst/Ktest.+003+49667.key.in X 2001,2004,2013,2018 -./bin/tests/dst/Makefile.in MAKE 1999,2000,2001,2002,2004,2006,2007,2008,2009,2010,2012,2013,2014,2016,2017,2018 -./bin/tests/dst/dst_2_data.in X 1999,2000,2001,2013,2018 -./bin/tests/dst/dst_test.c C 1999,2000,2001,2004,2005,2007,2009,2012,2014,2015,2016,2018 -./bin/tests/dst/gsstest.c C 2006,2007,2009,2010,2011,2013,2014,2015,2016,2018 -./bin/tests/dst/t2_data_1.in X 1999,2000,2001,2013,2018 -./bin/tests/dst/t2_data_2.in X 1999,2000,2001,2013,2018 -./bin/tests/dst/t2_dsasig.in X 1999,2000,2001,2013,2018 -./bin/tests/dst/t2_rsasig.in X 1999,2000,2001,2013,2018 -./bin/tests/dst/t_dst.c C 1999,2000,2001,2004,2005,2007,2008,2009,2011,2012,2013,2014,2016,2017,2018 -./bin/tests/dst/win32/REQUIRE_EXTENDED_DIR X 2013,2018 -./bin/tests/dst/win32/t_dst.vcxproj.filters.in X 2013,2015,2018 -./bin/tests/dst/win32/t_dst.vcxproj.in X 2013,2015,2016,2017,2018 -./bin/tests/dst/win32/t_dst.vcxproj.user X 2013,2018 -./bin/tests/entropy2_test.c C 2000,2001,2004,2005,2007,2015,2016,2018 -./bin/tests/entropy_test.c C 2000,2001,2004,2005,2007,2015,2016,2018 ./bin/tests/fromhex.pl PERL 2015,2016,2018 ./bin/tests/fsaccess_test.c C 2000,2001,2004,2005,2007,2012,2015,2016,2018 ./bin/tests/hash_test.c C 2000,2001,2004,2005,2006,2007,2014,2015,2016,2017,2018 @@ -387,7 +360,42 @@ ./bin/tests/named.conf CONF-C 1999,2000,2001,2004,2007,2011,2015,2016,2018 ./bin/tests/ndc.conf CONF-C 2000,2001,2004,2007,2016,2018 ./bin/tests/ndc.conf-include CONF-C 2001,2004,2007,2016,2018 -./bin/tests/nsecify.c C 1999,2000,2001,2003,2004,2007,2008,2009,2011,2015,2016,2017,2018 +./bin/tests/optional/Kchild.example.+003+04017.key X 2000,2001,2018 +./bin/tests/optional/Kchild.example.+003+04017.private X 2000,2001,2018 +./bin/tests/optional/Makefile.in MAKE 2018 +./bin/tests/optional/adb_test.c C 1999,2000,2001,2004,2005,2007,2009,2011,2012,2013,2015,2016,2018 +./bin/tests/optional/backtrace_test.c C 2009,2013,2015,2016,2018 +./bin/tests/optional/byaddr_test.c C 2000,2001,2002,2004,2005,2007,2012,2015,2016,2018 +./bin/tests/optional/byname_test.c C 2000,2001,2004,2005,2007,2009,2012,2015,2016,2017,2018 +./bin/tests/optional/db_test.c C 1999,2000,2001,2004,2005,2007,2008,2009,2011,2012,2013,2015,2016,2017,2018 +./bin/tests/optional/dst_test.c C 2018 +./bin/tests/optional/entropy2_test.c C 2000,2001,2004,2005,2007,2015,2016,2018 +./bin/tests/optional/entropy_test.c C 2000,2001,2004,2005,2007,2015,2016,2018 +./bin/tests/optional/fsaccess_test.c C 2000,2001,2004,2005,2007,2012,2015,2016,2018 +./bin/tests/optional/gsstest.c C 2018 +./bin/tests/optional/hash_test.c C 2000,2001,2004,2005,2006,2007,2014,2015,2016,2017,2018 +./bin/tests/optional/inter_test.c C 2000,2001,2003,2004,2005,2007,2008,2015,2016,2018 +./bin/tests/optional/keyboard_test.c C 2000,2001,2004,2005,2007,2015,2016,2018 +./bin/tests/optional/lex_test.c C 1998,1999,2000,2001,2004,2005,2007,2015,2016,2018 +./bin/tests/optional/lfsr_test.c C 1999,2000,2001,2004,2005,2007,2015,2016,2018 +./bin/tests/optional/log_test.c C 1999,2000,2001,2004,2007,2011,2014,2015,2016,2018 +./bin/tests/optional/master_test.c C 1999,2000,2001,2004,2007,2009,2015,2016,2017,2018 +./bin/tests/optional/mempool_test.c C 1999,2000,2001,2004,2007,2016,2018 +./bin/tests/optional/name_test.c C 1998,1999,2000,2001,2003,2004,2005,2007,2009,2015,2016,2017,2018 +./bin/tests/optional/nsecify.c C 1999,2000,2001,2003,2004,2007,2008,2009,2011,2015,2016,2017,2018 +./bin/tests/optional/ratelimiter_test.c C 1999,2000,2001,2004,2007,2015,2016,2018 +./bin/tests/optional/rbt_test.c C 1999,2000,2001,2004,2005,2007,2009,2011,2012,2014,2015,2016,2018 +./bin/tests/optional/rbt_test.out X 1999,2000,2001,2018 +./bin/tests/optional/rbt_test.txt SH 1999,2000,2001,2004,2007,2012,2016,2018 +./bin/tests/optional/rwlock_test.c C 1998,1999,2000,2001,2004,2005,2007,2013,2016,2017,2018 +./bin/tests/optional/serial_test.c C 1999,2000,2001,2003,2004,2007,2015,2016,2018 +./bin/tests/optional/shutdown_test.c C 1998,1999,2000,2001,2004,2007,2011,2013,2016,2017,2018 +./bin/tests/optional/sig0_test.c C 2000,2001,2004,2005,2007,2008,2009,2012,2015,2016,2018 +./bin/tests/optional/sock_test.c C 1998,1999,2000,2001,2004,2007,2008,2012,2013,2014,2015,2016,2017,2018 +./bin/tests/optional/sym_test.c C 1998,1999,2000,2001,2004,2005,2007,2015,2016,2018 +./bin/tests/optional/task_test.c C 1998,1999,2000,2001,2004,2007,2013,2014,2015,2016,2018 +./bin/tests/optional/timer_test.c C 1998,1999,2000,2001,2004,2007,2013,2014,2015,2016,2018 +./bin/tests/optional/zone_test.c C 1999,2000,2001,2002,2004,2005,2007,2009,2012,2014,2015,2016,2018 ./bin/tests/pkcs11/.gitignore X 2014,2018 ./bin/tests/pkcs11/Makefile.in MAKE 2014,2016,2018 ./bin/tests/pkcs11/README X 2014,2016,2018 @@ -3481,6 +3489,7 @@ ./lib/dns/tests/dnstap_test.c C 2015,2016,2017,2018 ./lib/dns/tests/dnstest.c C 2011,2012,2013,2014,2015,2016,2017,2018 ./lib/dns/tests/dnstest.h C 2011,2012,2014,2015,2016,2017,2018 +./lib/dns/tests/dst_test.c C 2018 ./lib/dns/tests/dstrandom_test.c C 2017,2018 ./lib/dns/tests/geoip_test.c C 2013,2014,2015,2016,2017,2018 ./lib/dns/tests/gost_test.c C 2014,2015,2016,2017,2018 @@ -3497,6 +3506,7 @@ ./lib/dns/tests/rdataset_test.c C 2012,2016,2018 ./lib/dns/tests/rdatasetstats_test.c C 2012,2015,2016,2018 ./lib/dns/tests/rsa_test.c C 2016,2018 +./lib/dns/tests/testdata/db/data.db ZONE 2018 ./lib/dns/tests/testdata/dbiterator/zone1.data ZONE 2011,2012,2016,2018 ./lib/dns/tests/testdata/dbiterator/zone2.data X 2011,2018 ./lib/dns/tests/testdata/diff/zone1.data ZONE 2011,2012,2016,2018 @@ -3508,6 +3518,16 @@ ./lib/dns/tests/testdata/dnstap/query.recursive X 2015,2018 ./lib/dns/tests/testdata/dnstap/response.auth X 2015,2018 ./lib/dns/tests/testdata/dnstap/response.recursive X 2015,2018 +./lib/dns/tests/testdata/dst/Ktest.+001+00002.key X 2018 +./lib/dns/tests/testdata/dst/Ktest.+001+54622.key X 2018 +./lib/dns/tests/testdata/dst/Ktest.+001+54622.private X 2018 +./lib/dns/tests/testdata/dst/Ktest.+003+23616.key X 2018 +./lib/dns/tests/testdata/dst/Ktest.+003+23616.private X 2018 +./lib/dns/tests/testdata/dst/Ktest.+003+49667.key X 2018 +./lib/dns/tests/testdata/dst/test1.data X 2018 +./lib/dns/tests/testdata/dst/test1.dsasig X 2018 +./lib/dns/tests/testdata/dst/test1.rsasig X 2018 +./lib/dns/tests/testdata/dst/test2.data X 2018 ./lib/dns/tests/testdata/dstrandom/random.data X 2017,2018 ./lib/dns/tests/testdata/master/.gitignore X 2012,2018 ./lib/dns/tests/testdata/master/master1.data X 2011,2018 diff --git a/win32utils/Configure b/win32utils/Configure index 7c670e5c07c..c5197881579 100644 --- a/win32utils/Configure +++ b/win32utils/Configure @@ -116,8 +116,6 @@ my @projectlist = ("..\\bin\\check\\win32\\checkconf.vcxproj", "..\\bin\\tools\\win32\\nsec3hash.vcxproj.filters", "..\\bin\\tools\\win32\\rrchecker.vcxproj", "..\\bin\\tools\\win32\\rrchecker.vcxproj.filters", - "..\\bin\\tests\\dst\\win32\\t_dst.vcxproj", - "..\\bin\\tests\\dst\\win32\\t_dst.vcxproj.filters", "..\\bin\\tests\\system\\win32\\bigkey.vcxproj", "..\\bin\\tests\\system\\win32\\bigkey.vcxproj.filters", "..\\bin\\tests\\system\\win32\\feature-test.vcxproj", diff --git a/win32utils/bind9.sln.in b/win32utils/bind9.sln.in index a8ff894a017..6119af1b0a3 100644 --- a/win32utils/bind9.sln.in +++ b/win32utils/bind9.sln.in @@ -496,19 +496,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pk11tokens", "..\bin\pkcs11 EndProjectSection EndProject @END PKCS11 -@IF TESTS -@IF ATOMIC -@END ATOMIC -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "t_dst", "..\bin\tests\dst\win32\t_dst.vcxproj", "{EE9B94CF-7C33-4F3B-A674-FB756D422C54}" - ProjectSection(ProjectDependencies) = postProject - {A3F71D12-F38A-4C77-8D87-8E8854CA74A1} = {A3F71D12-F38A-4C77-8D87-8E8854CA74A1} - {3840E563-D180-4761-AA9C-E6155F02EAFF} = {3840E563-D180-4761-AA9C-E6155F02EAFF} - {5FEBFD4E-CCB0-48B9-B733-E15EEB85C16A} = {5FEBFD4E-CCB0-48B9-B733-E15EEB85C16A} - {F6F08940-7597-4FEE-9CE0-E09A009C45A3} = {F6F08940-7597-4FEE-9CE0-E09A009C45A3} - {B4AC7F81-E3DC-43E9-B339-4FA5149FA8F7} = {B4AC7F81-E3DC-43E9-B339-4FA5149FA8F7} - EndProjectSection -EndProject -@END TESTS @IF XTESTS Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "backtrace_test", "..\bin\tests\win32\backtrace_test.vcxproj", "{14751171-C40E-40EE-A2F0-37FFC3CCD4A2}" ProjectSection(ProjectDependencies) = postProject