sdig
*_test
gsstest
-t_dst
conf.sh
dlopen
lwtest
LIBS = @LIBS@
-SUBDIRS = dst system optional
+SUBDIRS = system optional
# Test programs that are built by default:
# cfg_test is needed for regenerating doc/misc/options
+++ /dev/null
-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
+++ /dev/null
-dh. IN KEY 0 2 2 AAEBAAAAYIHI/wjtOagNga9GILSoS02IVelgLilPE/TfhtvShsiDAXqb IfxQcj2JkuOnNLs5ttb2WZXWl5/jsSjIxHMwMF2XY4gwt/lwHBf/vgYH r7aIxnKXov1jk9rymTLHGKIOtg==
+++ /dev/null
-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
+++ /dev/null
-dh. IN KEY 0 2 2 AAEBAAAAYOuaKjyMXYame2F6/ZFdEmXv0a2edB+69PEZgrExA6SJlivn 4KqAsfBHr/+0BCb+7nfWeMDSh2BXnSzWkXF1wMaCHMuz9EleG1gKFKeV Q9gKli88Cb8/jbovWChrGBNp2w==
+++ /dev/null
-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
+++ /dev/null
-# Copyright (C) 2004, 2006-2010, 2012-2014 Internet Systems Consortium, Inc. ("ISC")
-# Copyright (C) 1999-2002 Internet Software Consortium.
-#
-# Permission to use, copy, modify, and/or distribute this software for any
-# purpose with or without fee is hereby granted, provided that the above
-# copyright notice and this permission notice appear in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
-# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-# AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
-# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
-# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
-# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-# PERFORMANCE OF THIS SOFTWARE.
-
-srcdir = @srcdir@
-VPATH = @srcdir@
-top_srcdir = @top_srcdir@
-
-@BIND9_MAKE_INCLUDES@
-
-CINCLUDES = ${TEST_INCLUDES} ${DNS_INCLUDES} \
- ${ISC_INCLUDES} @DST_GSSAPI_INC@
-
-CDEFINES = @USE_GSSAPI@
-CWARNINGS =
-
-DNSLIBS = ../../../lib/dns/libdns.@A@ @DNS_CRYPTO_LIBS@
-ISCLIBS = ../../../lib/isc/libisc.@A@
-
-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
+++ /dev/null
-#
-# 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
+++ /dev/null
-/*
- * Copyright (C) 2004, 2005, 2007-2009, 2011-2014, 2016, 2017 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
- * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
- * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
- * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-/* $Id: t_dst.c,v 1.60 2011/03/17 23:47:29 tbox Exp $ */
-
-#include <config.h>
-
-#include <errno.h>
-#include <fcntl.h>
-#include <limits.h>
-#include <stdlib.h>
-
-#ifndef WIN32
-#include <unistd.h> /* XXX */
-#else
-#include <direct.h>
-#endif
-
-#include <isc/buffer.h>
-#include <isc/dir.h>
-#include <isc/entropy.h>
-#include <isc/file.h>
-#include <isc/mem.h>
-#include <isc/print.h>
-#include <isc/region.h>
-#include <isc/stdio.h>
-#include <isc/string.h>
-#include <isc/util.h>
-
-#include <dns/fixedname.h>
-#include <dns/name.h>
-
-#include <dst/dst.h>
-#include <dst/result.h>
-
-#include <tests/t_api.h>
-
-#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_create(key, mctx, &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_create(key, mctx, &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_create(key, mctx, &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_create(key, mctx, &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
+++ /dev/null
-# Microsoft Developer Studio Project File - Name="t_dst" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "@PLATFORM@ (x86) Console Application" 0x0103
-
-CFG=t_dst - @PLATFORM@ Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "t_dst.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "t_dst.mak" CFG="t_dst - @PLATFORM@ Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "t_dst - @PLATFORM@ Release" (based on "@PLATFORM@ (x86) Console Application")
-!MESSAGE "t_dst - @PLATFORM@ Debug" (based on "@PLATFORM@ (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "t_dst - @PLATFORM@ Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 @COPTX@ @COPTI@ /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" @COPTY@ /FD /c
-# ADD CPP /nologo /MD /W3 @COPTX@ @COPTI@ /O2 /I "./" /I "../../../../" @LIBXML2_INC@ /I "../../../../lib/isc/win32" /I "../../../../lib/isc/win32/include" /I "../../../../lib/isc/include" /I "../../../../lib/dns/win32/include" /I "../../../../lib/dns/include" /I "../../../../lib/tests/include" /D "WIN32" /D "NDEBUG" /D "__STDC__" /D "_CONSOLE" /D "_MBCS" @COPTY@ /FD /c
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console @MACHINE@
-# ADD LINK32 @LIBXML2_LIB@ user32.lib advapi32.lib kernel32.lib ws2_32.lib ../../../../lib/isc/win32/Release/libisc.lib ../../../../lib/dns/win32/Release/libdns.lib ../../../../lib/tests/win32/Release/libtests.lib /nologo /subsystem:console @MACHINE@ /out:"../../../../Build/Release/t_dst.exe"
-
-!ELSEIF "$(CFG)" == "t_dst - @PLATFORM@ Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm @COPTX@ @COPTI@ /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" @COPTY@ /FD /GZ /c
-# ADD CPP /nologo /MDd /W3 /Gm @COPTX@ @COPTI@ /ZI /Od /I "./" /I "../../../../" @LIBXML2_INC@ /I "../../../../lib/isc/win32" /I "../../../../lib/isc/win32/include" /I "../../../../lib/isc/include" /I "../../../../lib/dns/win32/include" /I "../../../../lib/dns/include" /I "../../../../lib/tests/include" /I "../../../../lib/bind9/include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "i386" /FR /FD /GZ /c
-# SUBTRACT CPP /X @COPTY@
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug @MACHINE@ /pdbtype:sept
-# ADD LINK32 @LIBXML2_LIB@ user32.lib advapi32.lib kernel32.lib ws2_32.lib ../../../../lib/isc/win32/Debug/libisc.lib ../../../../lib/dns/win32/Debug/libdns.lib ../../../../lib/tests/win32/Debug/libtests.lib /nologo /subsystem:console /map /debug @MACHINE@ /out:"../../../../Build/Debug/t_dst.exe" /pdbtype:sept
-
-!ENDIF
-
-# Begin Target
-
-# Name "t_dst - @PLATFORM@ Release"
-# Name "t_dst - @PLATFORM@ Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\t_dst.c
-# End Source File
-# End Group
-# End Target
-# End Project
+++ /dev/null
-Microsoft Developer Studio Workspace File, Format Version 6.00
-# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
-
-###############################################################################
-
-Project: "t_dst"=".\t_dst.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Global:
-
-Package=<5>
-{{{
-}}}
-
-Package=<3>
-{{{
-}}}
-
-###############################################################################
-
+++ /dev/null
-# Microsoft Developer Studio Generated NMAKE File, Based on t_dst.dsp
-!IF "$(CFG)" == ""
-CFG=t_dst - @PLATFORM@ Debug
-!MESSAGE No configuration specified. Defaulting to t_dst - @PLATFORM@ Debug.
-!ENDIF
-
-!IF "$(CFG)" != "t_dst - @PLATFORM@ Release" && "$(CFG)" != "t_dst - @PLATFORM@ Debug"
-!MESSAGE Invalid configuration "$(CFG)" specified.
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "t_dst.mak" CFG="t_dst - @PLATFORM@ Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "t_dst - @PLATFORM@ Release" (based on "@PLATFORM@ (x86) Console Application")
-!MESSAGE "t_dst - @PLATFORM@ Debug" (based on "@PLATFORM@ (x86) Console Application")
-!MESSAGE
-!ERROR An invalid configuration is specified.
-!ENDIF
-
-!IF "$(OS)" == "Windows_NT"
-NULL=
-!ELSE
-NULL=nul
-!ENDIF
-
-CPP=cl.exe
-RSC=rc.exe
-LIBXML=@LIBXML2_LIB@
-
-!IF "$(CFG)" == "t_dst - @PLATFORM@ Release"
-_VC_MANIFEST_INC=0
-_VC_MANIFEST_BASENAME=__VC80
-!ELSE
-_VC_MANIFEST_INC=1
-_VC_MANIFEST_BASENAME=__VC80.Debug
-!ENDIF
-
-####################################################
-# Specifying name of temporary resource file used only in incremental builds:
-
-!if "$(_VC_MANIFEST_INC)" == "1"
-_VC_MANIFEST_AUTO_RES=$(_VC_MANIFEST_BASENAME).auto.res
-!else
-_VC_MANIFEST_AUTO_RES=
-!endif
-
-####################################################
-# _VC_MANIFEST_EMBED_EXE - command to embed manifest in EXE:
-
-!if "$(_VC_MANIFEST_INC)" == "1"
-
-#MT_SPECIAL_RETURN=1090650113
-#MT_SPECIAL_SWITCH=-notify_resource_update
-MT_SPECIAL_RETURN=0
-MT_SPECIAL_SWITCH=
-_VC_MANIFEST_EMBED_EXE= \
-if exist $@.manifest mt.exe -manifest $@.manifest -out:$(_VC_MANIFEST_BASENAME).auto.manifest $(MT_SPECIAL_SWITCH) & \
-if "%ERRORLEVEL%" == "$(MT_SPECIAL_RETURN)" \
-rc /r $(_VC_MANIFEST_BASENAME).auto.rc & \
-link $** /out:$@ $(LFLAGS)
-
-!else
-
-_VC_MANIFEST_EMBED_EXE= \
-if exist $@.manifest mt.exe -manifest $@.manifest -outputresource:$@;1
-
-!endif
-
-####################################################
-# _VC_MANIFEST_EMBED_DLL - command to embed manifest in DLL:
-
-!if "$(_VC_MANIFEST_INC)" == "1"
-
-#MT_SPECIAL_RETURN=1090650113
-#MT_SPECIAL_SWITCH=-notify_resource_update
-MT_SPECIAL_RETURN=0
-MT_SPECIAL_SWITCH=
-_VC_MANIFEST_EMBED_EXE= \
-if exist $@.manifest mt.exe -manifest $@.manifest -out:$(_VC_MANIFEST_BASENAME).auto.manifest $(MT_SPECIAL_SWITCH) & \
-if "%ERRORLEVEL%" == "$(MT_SPECIAL_RETURN)" \
-rc /r $(_VC_MANIFEST_BASENAME).auto.rc & \
-link $** /out:$@ $(LFLAGS)
-
-!else
-
-_VC_MANIFEST_EMBED_EXE= \
-if exist $@.manifest mt.exe -manifest $@.manifest -outputresource:$@;2
-
-!endif
-####################################################
-# _VC_MANIFEST_CLEAN - command to clean resources files generated temporarily:
-
-!if "$(_VC_MANIFEST_INC)" == "1"
-
-_VC_MANIFEST_CLEAN=-del $(_VC_MANIFEST_BASENAME).auto.res \
- $(_VC_MANIFEST_BASENAME).auto.rc \
- $(_VC_MANIFEST_BASENAME).auto.manifest
-
-!else
-
-_VC_MANIFEST_CLEAN=
-
-!endif
-
-!IF "$(CFG)" == "t_dst - @PLATFORM@ Release"
-
-OUTDIR=.\Release
-INTDIR=.\Release
-
-!IF "$(RECURSE)" == "0"
-
-ALL : "..\..\..\..\Build\Release\t_dst.exe"
-
-!ELSE
-
-ALL : "libtests - @PLATFORM@ Release" "libisc - @PLATFORM@ Release" "libdns - @PLATFORM@ Release" "..\..\..\..\Build\Release\t_dst.exe"
-
-!ENDIF
-
-!IF "$(RECURSE)" == "1"
-CLEAN :"libdns - @PLATFORM@ ReleaseCLEAN" "libisc - @PLATFORM@ ReleaseCLEAN" "libtests - @PLATFORM@ ReleaseCLEAN"
-!ELSE
-CLEAN :
-!ENDIF
- -@erase "$(INTDIR)\t_dst.obj"
- -@erase "$(INTDIR)\vc60.idb"
- -@erase "..\..\..\..\Build\Release\t_dst.exe"
- -@$(_VC_MANIFEST_CLEAN)
-
-"$(OUTDIR)" :
- if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
-
-CPP_PROJ=/nologo /MD /W3 @COPTX@ @COPTI@ /O2 /I "./" /I "../../../../" @LIBXML2_INC@ /I "../../../../lib/isc/win32" /I "../../../../lib/isc/win32/include" /I "../../../../lib/isc/include" /I "../../../../lib/dns/win32/include" /I "../../../../lib/dns/include" /I "../../../../lib/tests/include" /D "WIN32" /D "NDEBUG" /D "__STDC__" /D "_CONSOLE" /D "_MBCS" /Fp"$(INTDIR)\t_dst.pch" @COPTY@ /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
-BSC32=bscmake.exe
-BSC32_FLAGS=/nologo /o"$(OUTDIR)\t_dst.bsc"
-BSC32_SBRS= \
-
-LINK32=link.exe
-LINK32_FLAGS=user32.lib advapi32.lib kernel32.lib ws2_32.lib ../../../../lib/isc/win32/Release/libisc.lib ../../../../lib/dns/win32/Release/libdns.lib ../../../../lib/tests/win32/Release/libtests.lib $(LIBXML) /nologo /subsystem:console /incremental:no /pdb:"$(OUTDIR)\t_dst.pdb" @MACHINE@ /out:"../../../../Build/Release/t_dst.exe"
-LINK32_OBJS= \
- "$(INTDIR)\t_dst.obj" \
- "..\..\..\..\lib\dns\win32\Release\libdns.lib" \
- "..\..\..\..\lib\isc\win32\Release\libisc.lib" \
- "..\..\..\..\lib\tests\win32\Release\libtests.lib"
-
-"..\..\..\..\Build\Release\t_dst.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
- $(LINK32) @<<
- $(LINK32_FLAGS) $(LINK32_OBJS)
-<<
- $(_VC_MANIFEST_EMBED_EXE)
-
-!ELSEIF "$(CFG)" == "t_dst - @PLATFORM@ Debug"
-
-OUTDIR=.\Debug
-INTDIR=.\Debug
-# Begin Custom Macros
-OutDir=.\Debug
-# End Custom Macros
-
-!IF "$(RECURSE)" == "0"
-
-ALL : "..\..\..\..\Build\Debug\t_dst.exe" "$(OUTDIR)\t_dst.bsc"
-
-!ELSE
-
-ALL : "libtests - @PLATFORM@ Debug" "libisc - @PLATFORM@ Debug" "libdns - @PLATFORM@ Debug" "..\..\..\..\Build\Debug\t_dst.exe" "$(OUTDIR)\t_dst.bsc"
-
-!ENDIF
-
-!IF "$(RECURSE)" == "1"
-CLEAN :"libdns - @PLATFORM@ DebugCLEAN" "libisc - @PLATFORM@ DebugCLEAN" "libtests - @PLATFORM@ DebugCLEAN"
-!ELSE
-CLEAN :
-!ENDIF
- -@erase "$(INTDIR)\t_dst.obj"
- -@erase "$(INTDIR)\t_dst.sbr"
- -@erase "$(INTDIR)\vc60.idb"
- -@erase "$(INTDIR)\vc60.pdb"
- -@erase "$(OUTDIR)\t_dst.bsc"
- -@erase "$(OUTDIR)\t_dst.map"
- -@erase "$(OUTDIR)\t_dst.pdb"
- -@erase "..\..\..\..\Build\Debug\t_dst.exe"
- -@erase "..\..\..\..\Build\Debug\t_dst.ilk"
- -@$(_VC_MANIFEST_CLEAN)
-
-"$(OUTDIR)" :
- if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
-
-CPP_PROJ=/nologo /MDd /W3 /Gm @COPTX@ @COPTI@ /ZI /Od /I "./" /I "../../../../" @LIBXML2_INC@ /I "../../../../lib/isc/win32" /I "../../../../lib/isc/win32/include" /I "../../../../lib/isc/include" /I "../../../../lib/dns/win32/include" /I "../../../../lib/dns/include" /I "../../../../lib/tests/include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "i386" /FR"$(INTDIR)\\" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c
-BSC32=bscmake.exe
-BSC32_FLAGS=/nologo /o"$(OUTDIR)\t_dst.bsc"
-BSC32_SBRS= \
- "$(INTDIR)\t_dst.sbr"
-
-"$(OUTDIR)\t_dst.bsc" : "$(OUTDIR)" $(BSC32_SBRS)
- $(BSC32) @<<
- $(BSC32_FLAGS) $(BSC32_SBRS)
-<<
-
-LINK32=link.exe
-LINK32_FLAGS=user32.lib advapi32.lib kernel32.lib ws2_32.lib ../../../../lib/isc/win32/Debug/libisc.lib ../../../../lib/dns/win32/Debug/libdns.lib ../../../../lib/tests/win32/Debug/libtests.lib $(LIBXML) /nologo /subsystem:console /incremental:yes /pdb:"$(OUTDIR)\t_dst.pdb" /map:"$(INTDIR)\t_dst.map" /debug @MACHINE@ /out:"../../../../Build/Debug/t_dst.exe" /pdbtype:sept
-LINK32_OBJS= \
- "$(INTDIR)\t_dst.obj" \
- "..\..\..\..\lib\dns\win32\Debug\libdns.lib" \
- "..\..\..\..\lib\isc\win32\Debug\libisc.lib" \
- "..\..\..\..\lib\tests\win32\Debug\libtests.lib"
-
-"..\..\..\..\Build\Debug\t_dst.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
- $(LINK32) @<<
- $(LINK32_FLAGS) $(LINK32_OBJS)
-<<
- $(_VC_MANIFEST_EMBED_EXE)
-
-!ENDIF
-
-.c{$(INTDIR)}.obj::
- $(CPP) @<<
- $(CPP_PROJ) $<
-<<
-
-.cpp{$(INTDIR)}.obj::
- $(CPP) @<<
- $(CPP_PROJ) $<
-<<
-
-.cxx{$(INTDIR)}.obj::
- $(CPP) @<<
- $(CPP_PROJ) $<
-<<
-
-.c{$(INTDIR)}.sbr::
- $(CPP) @<<
- $(CPP_PROJ) $<
-<<
-
-.cpp{$(INTDIR)}.sbr::
- $(CPP) @<<
- $(CPP_PROJ) $<
-<<
-
-.cxx{$(INTDIR)}.sbr::
- $(CPP) @<<
- $(CPP_PROJ) $<
-<<
-
-
-!IF "$(NO_EXTERNAL_DEPS)" != "1"
-!IF EXISTS("t_dst.dep")
-!INCLUDE "t_dst.dep"
-!ELSE
-!MESSAGE Warning: cannot find "t_dst.dep"
-!ENDIF
-!ENDIF
-
-
-!IF "$(CFG)" == "t_dst - @PLATFORM@ Release" || "$(CFG)" == "t_dst - @PLATFORM@ Debug"
-SOURCE=..\t_dst.c
-
-!IF "$(CFG)" == "t_dst - @PLATFORM@ Release"
-
-
-"$(INTDIR)\t_dst.obj" : $(SOURCE) "$(INTDIR)"
- $(CPP) $(CPP_PROJ) $(SOURCE)
-
-
-!ELSEIF "$(CFG)" == "t_dst - @PLATFORM@ Debug"
-
-
-"$(INTDIR)\t_dst.obj" "$(INTDIR)\t_dst.sbr" : $(SOURCE) "$(INTDIR)"
- $(CPP) $(CPP_PROJ) $(SOURCE)
-
-
-!ENDIF
-
-!IF "$(CFG)" == "t_dst - @PLATFORM@ Release"
-
-"libdns - @PLATFORM@ Release" :
- cd "..\..\..\..\lib\dns\win32"
- $(MAKE) /$(MAKEFLAGS) /F ".\libdns.mak" CFG="libdns - @PLATFORM@ Release"
- cd "..\..\..\bin\tests\dst\win32"
-
-"libdns - @PLATFORM@ ReleaseCLEAN" :
- cd "..\..\..\..\lib\dns\win32"
- $(MAKE) /$(MAKEFLAGS) /F ".\libdns.mak" CFG="libdns - @PLATFORM@ Release" RECURSE=1 CLEAN
- cd "..\..\..\bin\tests\dst\win32"
-
-!ELSEIF "$(CFG)" == "t_dst - @PLATFORM@ Debug"
-
-"libdns - @PLATFORM@ Debug" :
- cd "..\..\..\..\lib\dns\win32"
- $(MAKE) /$(MAKEFLAGS) /F ".\libdns.mak" CFG="libdns - @PLATFORM@ Debug"
- cd "..\..\..\bin\tests\dst\win32"
-
-"libdns - @PLATFORM@ DebugCLEAN" :
- cd "..\..\..\..\lib\dns\win32"
- $(MAKE) /$(MAKEFLAGS) /F ".\libdns.mak" CFG="libdns - @PLATFORM@ Debug" RECURSE=1 CLEAN
- cd "..\..\..\bin\tests\dst\win32"
-
-!ENDIF
-
-!IF "$(CFG)" == "t_dst - @PLATFORM@ Release"
-
-"libisc - @PLATFORM@ Release" :
- cd "..\..\..\..\lib\isc\win32"
- $(MAKE) /$(MAKEFLAGS) /F ".\libisc.mak" CFG="libisc - @PLATFORM@ Release"
- cd "..\..\..\bin\tests\dst\win32"
-
-"libisc - @PLATFORM@ ReleaseCLEAN" :
- cd "..\..\..\..\lib\isc\win32"
- $(MAKE) /$(MAKEFLAGS) /F ".\libisc.mak" CFG="libisc - @PLATFORM@ Release" RECURSE=1 CLEAN
- cd "..\..\..\bin\tests\dst\win32"
-
-!ELSEIF "$(CFG)" == "t_dst - @PLATFORM@ Debug"
-
-"libisc - @PLATFORM@ Debug" :
- cd "..\..\..\..\lib\isc\win32"
- $(MAKE) /$(MAKEFLAGS) /F ".\libisc.mak" CFG="libisc - @PLATFORM@ Debug"
- cd "..\..\..\bin\tests\dst\win32"
-
-"libisc - @PLATFORM@ DebugCLEAN" :
- cd "..\..\..\..\lib\isc\win32"
- $(MAKE) /$(MAKEFLAGS) /F ".\libisc.mak" CFG="libisc - @PLATFORM@ Debug" RECURSE=1 CLEAN
- cd "..\..\..\bin\tests\dst\win32"
-
-!ENDIF
-
-!IF "$(CFG)" == "t_dst - @PLATFORM@ Release"
-
-"libtests - @PLATFORM@ Release" :
- cd "..\..\..\..\lib\tests\win32"
- $(MAKE) /$(MAKEFLAGS) /F ".\libtests.mak" CFG="libtests - @PLATFORM@ Release"
- cd "..\..\..\bin\tests\dst\win32"
-
-"libtests - @PLATFORM@ ReleaseCLEAN" :
- cd "..\..\..\..\lib\tests\win32"
- $(MAKE) /$(MAKEFLAGS) /F ".\libtests.mak" CFG="libtests - @PLATFORM@ Release" RECURSE=1 CLEAN
- cd "..\..\..\bin\tests\dst\win32"
-
-!ELSEIF "$(CFG)" == "t_dst - @PLATFORM@ Debug"
-
-"libtests - @PLATFORM@ Debug" :
- cd "..\..\..\..\lib\tests\win32"
- $(MAKE) /$(MAKEFLAGS) /F ".\libtests.mak" CFG="libtests - @PLATFORM@ Debug"
- cd "..\..\..\bin\tests\dst\win32"
-
-"libtests - @PLATFORM@ DebugCLEAN" :
- cd "..\..\..\..\lib\tests\win32"
- $(MAKE) /$(MAKEFLAGS) /F ".\libtests.mak" CFG="libtests - @PLATFORM@ Debug" RECURSE=1 CLEAN
- cd "..\..\..\bin\t_dst\win32"
-
-!ENDIF
-
-
-!ENDIF
-
-####################################################
-# Commands to generate initial empty manifest file and the RC file
-# that references it, and for generating the .res file:
-
-$(_VC_MANIFEST_BASENAME).auto.res : $(_VC_MANIFEST_BASENAME).auto.rc
-
-$(_VC_MANIFEST_BASENAME).auto.rc : $(_VC_MANIFEST_BASENAME).auto.manifest
- type <<$@
-#include <winuser.h>
-1RT_MANIFEST"$(_VC_MANIFEST_BASENAME).auto.manifest"
-<< KEEP
-
-$(_VC_MANIFEST_BASENAME).auto.manifest :
- type <<$@
-<?xml version='1.0' encoding='UTF-8' standalone='yes'?>
-<assembly xmlns='urn:schemas-microsoft-com:asm.v1' manifestVersion='1.0'>
-</assembly>
-<< KEEP
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <ItemGroup>
- <Filter Include="Source Files">
- <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
- <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
- </Filter>
- <Filter Include="Header Files">
- <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
- <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
- </Filter>
- <Filter Include="Resource Files">
- <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
- <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
- </Filter>
- </ItemGroup>
- <ItemGroup>
- <ClCompile Include="..\t_dst.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- </ItemGroup>
-</Project>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <ItemGroup Label="ProjectConfigurations">
- <ProjectConfiguration Include="Debug|@PLATFORM@">
- <Configuration>Debug</Configuration>
- <Platform>@PLATFORM@</Platform>
- </ProjectConfiguration>
- <ProjectConfiguration Include="Release|@PLATFORM@">
- <Configuration>Release</Configuration>
- <Platform>@PLATFORM@</Platform>
- </ProjectConfiguration>
- </ItemGroup>
- <PropertyGroup Label="Globals">
- <ProjectGuid>{EE9B94CF-7C33-4F3B-A674-FB756D422C54}</ProjectGuid>
- <Keyword>Win32Proj</Keyword>
- <RootNamespace>t_dst</RootNamespace>
- </PropertyGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'" Label="Configuration">
- <ConfigurationType>Application</ConfigurationType>
- <UseDebugLibraries>true</UseDebugLibraries>
- <CharacterSet>MultiByte</CharacterSet>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'" Label="Configuration">
- <ConfigurationType>Application</ConfigurationType>
- <UseDebugLibraries>false</UseDebugLibraries>
- <WholeProgramOptimization>true</WholeProgramOptimization>
- <CharacterSet>MultiByte</CharacterSet>
- </PropertyGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
- <ImportGroup Label="ExtensionSettings">
- </ImportGroup>
- <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- </ImportGroup>
- <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- </ImportGroup>
- <PropertyGroup Label="UserMacros" />
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'">
- <LinkIncremental>true</LinkIncremental>
- <OutDir>..\..\..\..\Build\$(Configuration)\</OutDir>
- <IntDir>.\$(Configuration)\</IntDir>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
- <LinkIncremental>false</LinkIncremental>
- <OutDir>..\..\..\..\Build\$(Configuration)\</OutDir>
- <IntDir>.\$(Configuration)\</IntDir>
- </PropertyGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'">
- <ClCompile>
- <PrecompiledHeader>
- </PrecompiledHeader>
- <WarningLevel>Level3</WarningLevel>
- <Optimization>Disabled</Optimization>
- <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <FunctionLevelLinking>true</FunctionLevelLinking>
- <PrecompiledHeaderOutputFile>.\$(Configuration)\$(TargetName).pch</PrecompiledHeaderOutputFile>
- <AssemblerListingLocation>.\$(Configuration)\</AssemblerListingLocation>
- <ObjectFileName>.\$(Configuration)\</ObjectFileName>
- <ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
- <BrowseInformation>true</BrowseInformation>
- <AdditionalIncludeDirectories>.\;..\..\..\..\;@LIBXML2_INC@..\..\..\..\lib\isc\win32;..\..\..\..\lib\isc\win32\include;..\..\..\..\lib\isc\include;..\..\..\..\lib\dns\include;..\..\..\..\lib\tests\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <CompileAs>CompileAsC</CompileAs>
- </ClCompile>
- <Link>
- <SubSystem>Console</SubSystem>
- <GenerateDebugInformation>true</GenerateDebugInformation>
- <OutputFile>..\..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
- <AdditionalLibraryDirectories>..\..\..\..\lib\isc\win32\$(Configuration);..\..\..\..\lib\dns\win32\$(Configuration);..\..\..\..\lib\tests\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
- <AdditionalDependencies>@LIBXML2_LIB@libisc.lib;libdns.lib;libtests.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
- </Link>
- <PreBuildEvent>
- <Command>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
-</Command>
- </PreBuildEvent>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
- <ClCompile>
- <WarningLevel>Level3</WarningLevel>
- <PrecompiledHeader>
- </PrecompiledHeader>
- <Optimization>MaxSpeed</Optimization>
- <FunctionLevelLinking>true</FunctionLevelLinking>
- <IntrinsicFunctions>@INTRINSIC@</IntrinsicFunctions>
- <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
- <WholeProgramOptimization>false</WholeProgramOptimization>
- <StringPooling>true</StringPooling>
- <PrecompiledHeaderOutputFile>.\$(Configuration)\$(TargetName).pch</PrecompiledHeaderOutputFile>
- <AssemblerListingLocation>.\$(Configuration)\</AssemblerListingLocation>
- <ObjectFileName>.\$(Configuration)\</ObjectFileName>
- <ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
- <AdditionalIncludeDirectories>.\;..\..\..\..\;@LIBXML2_INC@..\..\..\..\lib\isc\win32;..\..\..\..\lib\isc\win32\include;..\..\..\..\lib\isc\include;..\..\..\..\lib\dns\include;..\..\..\..\lib\tests\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <CompileAs>CompileAsC</CompileAs>
- </ClCompile>
- <Link>
- <SubSystem>Console</SubSystem>
- <GenerateDebugInformation>false</GenerateDebugInformation>
- <EnableCOMDATFolding>true</EnableCOMDATFolding>
- <OptimizeReferences>true</OptimizeReferences>
- <OutputFile>..\..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
- <LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
- <AdditionalLibraryDirectories>..\..\..\..\lib\isc\win32\$(Configuration);..\..\..\..\lib\dns\win32\$(Configuration);..\..\..\..\lib\tests\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
- <AdditionalDependencies>@LIBXML2_LIB@libisc.lib;libdns.lib;libtests.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
- </Link>
- <PreBuildEvent>
- <Command>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
-</Command>
- </PreBuildEvent>
- </ItemDefinitionGroup>
- <ItemGroup>
- <ClCompile Include="..\t_dst.c" />
- </ItemGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
- <ImportGroup Label="ExtensionTargets">
- </ImportGroup>
-</Project>
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
-</Project>
\ No newline at end of file
# 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/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/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/keyzone.py bin/python/isc/tests/dnskey_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/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/inline/checkdsa.sh bin/tests/system/lwresd/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/check-secure-delegation.pl contrib/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/export/Makefile lib/export/dns/Makefile lib/export/dns/include/Makefile lib/export/dns/include/dns/Makefile lib/export/dns/include/dst/Makefile lib/export/irs/Makefile lib/export/irs/include/Makefile lib/export/irs/include/irs/Makefile lib/export/isc/$thread_dir/Makefile lib/export/isc/$thread_dir/include/Makefile lib/export/isc/$thread_dir/include/isc/Makefile lib/export/isc/Makefile lib/export/isc/include/Makefile lib/export/isc/include/isc/Makefile lib/export/isc/nls/Makefile lib/export/isc/unix/Makefile lib/export/isc/unix/include/Makefile lib/export/isc/unix/include/isc/Makefile lib/export/isccfg/Makefile lib/export/isccfg/include/Makefile lib/export/isccfg/include/isccfg/Makefile lib/export/samples/Makefile lib/export/samples/Makefile-postinstall 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/tests/Makefile lib/isc/nls/Makefile lib/isc/unix/Makefile lib/isc/unix/include/Makefile lib/isc/unix/include/isc/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/lwres/Makefile lib/lwres/include/Makefile lib/lwres/include/lwres/Makefile lib/lwres/include/lwres/netdb.h lib/lwres/include/lwres/platform.h lib/lwres/man/Makefile lib/lwres/tests/Makefile lib/lwres/unix/Makefile lib/lwres/unix/include/Makefile lib/lwres/unix/include/lwres/Makefile lib/tests/Makefile lib/tests/include/Makefile lib/tests/include/tests/Makefile 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/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/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/keyzone.py bin/python/isc/tests/dnskey_test.py bin/rndc/Makefile bin/tests/Makefile bin/tests/headerdep_test.sh bin/tests/optional/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/inline/checkdsa.sh bin/tests/system/lwresd/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/check-secure-delegation.pl contrib/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/export/Makefile lib/export/dns/Makefile lib/export/dns/include/Makefile lib/export/dns/include/dns/Makefile lib/export/dns/include/dst/Makefile lib/export/irs/Makefile lib/export/irs/include/Makefile lib/export/irs/include/irs/Makefile lib/export/isc/$thread_dir/Makefile lib/export/isc/$thread_dir/include/Makefile lib/export/isc/$thread_dir/include/isc/Makefile lib/export/isc/Makefile lib/export/isc/include/Makefile lib/export/isc/include/isc/Makefile lib/export/isc/nls/Makefile lib/export/isc/unix/Makefile lib/export/isc/unix/include/Makefile lib/export/isc/unix/include/isc/Makefile lib/export/isccfg/Makefile lib/export/isccfg/include/Makefile lib/export/isccfg/include/isccfg/Makefile lib/export/samples/Makefile lib/export/samples/Makefile-postinstall 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/tests/Makefile lib/isc/nls/Makefile lib/isc/unix/Makefile lib/isc/unix/include/Makefile lib/isc/unix/include/isc/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/lwres/Makefile lib/lwres/include/Makefile lib/lwres/include/lwres/Makefile lib/lwres/include/lwres/netdb.h lib/lwres/include/lwres/platform.h lib/lwres/man/Makefile lib/lwres/tests/Makefile lib/lwres/unix/Makefile lib/lwres/unix/include/Makefile lib/lwres/unix/include/lwres/Makefile lib/tests/Makefile lib/tests/include/Makefile lib/tests/include/tests/Makefile unit/Makefile unit/unittest.sh"
#
"bin/python/isc/tests/dnskey_test.py") CONFIG_FILES="$CONFIG_FILES bin/python/isc/tests/dnskey_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/system/Makefile") CONFIG_FILES="$CONFIG_FILES bin/tests/system/Makefile" ;;
bin/python/isc/tests/dnskey_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/system/Makefile
tp: dbversion_test
tp: dh_test
tp: dispatch_test
+tp: dst_test
tp: master_test
tp: name_test
tp: nsec3_test
dbiterator_test.c \
dh_test.c \
dispatch_test.c \
+ dst_test.c \
dnstest.c \
master_test.c \
name_test.c \
dbversion_test@EXEEXT@ \
dh_test@EXEEXT@ \
dispatch_test@EXEEXT@ \
+ dst_test@EXEEXT@ \
master_test@EXEEXT@ \
name_test@EXEEXT@ \
nsec3_test@EXEEXT@ \
dh_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}
+
tsig_test@EXEEXT@: tsig_test.@O@ dnstest.@O@ ${ISCDEPLIBS} ${DNSDEPLIBS}
${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ \
tsig_test.@O@ dnstest.@O@ ${DNSLIBS} \
--- /dev/null
+/*
+ * 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 <config.h>
+
+#include <atf-c.h>
+
+#include <unistd.h>
+
+#include <isc/file.h>
+#include <isc/util.h>
+#include <isc/stdio.h>
+#include <isc/string.h>
+
+#include <dst/dst.h>
+#include <dst/result.h>
+
+#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());
+}
F5CD6FB41FB15D4213705ABE9B563896
2196228648E0F8AA7F2F4EED3C19165C
1B4C70C9D69B93A1F2BE5B2F948CE023
-
./bin/tests/cfg_test.c C 2001,2002,2004,2005,2007,2009,2010,2011,2015
./bin/tests/compress_test.c C 1999,2000,2001,2004,2005,2006,2007,2015
./bin/tests/db_test.c C 1999,2000,2001,2004,2005,2007,2008,2009,2011,2012,2013,2015,2017
-./bin/tests/dst/.gitignore X 2012,2013
-./bin/tests/dst/Kdh.+002+18602.key.in X 2001,2013
-./bin/tests/dst/Kdh.+002+18602.private.in X 2001,2013
-./bin/tests/dst/Kdh.+002+48957.key.in X 2001,2013
-./bin/tests/dst/Kdh.+002+48957.private.in X 2001,2013
-./bin/tests/dst/Ktest.+001+00002.key.in X 2001,2004,2013
-./bin/tests/dst/Ktest.+001+54622.key.in X 1999,2000,2001,2004,2013
-./bin/tests/dst/Ktest.+001+54622.private.in X 1999,2000,2001,2013
-./bin/tests/dst/Ktest.+003+23616.key.in X 2001,2004,2013
-./bin/tests/dst/Ktest.+003+23616.private.in X 2001,2013
-./bin/tests/dst/Ktest.+003+49667.key.in X 2001,2004,2013
-./bin/tests/dst/Makefile.in MAKE 1999,2000,2001,2002,2004,2006,2007,2008,2009,2010,2012,2013,2014
-./bin/tests/dst/dst_2_data.in X 1999,2000,2001,2013
-./bin/tests/dst/dst_test.c C 1999,2000,2001,2004,2005,2007,2009,2012,2015,2018
-./bin/tests/dst/gsstest.c C 2006,2007,2009,2010,2011,2013,2014
-./bin/tests/dst/t2_data_1.in X 1999,2000,2001,2013
-./bin/tests/dst/t2_data_2.in X 1999,2000,2001,2013
-./bin/tests/dst/t2_dsasig.in X 1999,2000,2001,2013
-./bin/tests/dst/t2_rsasig.in X 1999,2000,2001,2013
-./bin/tests/dst/t_dst.c C 1999,2000,2001,2004,2005,2007,2008,2009,2011,2012,2013,2014,2016,2017
-./bin/tests/dst/win32/REQUIRE_EXTENDED_DIR X 2013
-./bin/tests/dst/win32/t_dst.dsp.in X 2013
-./bin/tests/dst/win32/t_dst.dsw X 2013
-./bin/tests/dst/win32/t_dst.mak.in X 2013
-./bin/tests/dst/win32/t_dst.vcxproj.filters.in X 2013,2015
-./bin/tests/dst/win32/t_dst.vcxproj.in X 2013,2015,2016,2017
-./bin/tests/dst/win32/t_dst.vcxproj.user X 2013
./bin/tests/entropy2_test.c C 2000,2001,2004,2005,2007,2015,2018
./bin/tests/entropy_test.c C 2000,2001,2004,2005,2007,2015,2018
./bin/tests/fromhex.pl PERL 2015
./lib/dns/tests/dispatch_test.c C 2012,2014
./lib/dns/tests/dnstest.c C 2011,2012,2013,2014,2015,2017
./lib/dns/tests/dnstest.h C 2011,2012,2015,2017
+./lib/dns/tests/dst_test.c C 2018
./lib/dns/tests/master_test.c C 2011,2012,2013,2015,2017
./lib/dns/tests/mkraw.pl PERL 2011,2012
./lib/dns/tests/name_test.c C 2014,2016,2018
"..\\bin\\tools\\win32\\journalprint.vcxproj.filters",
"..\\bin\\tools\\win32\\nsec3hash.vcxproj",
"..\\bin\\tools\\win32\\nsec3hash.vcxproj.filters",
- "..\\bin\\tests\\dst\\win32\\t_dst.vcxproj",
- "..\\bin\\tests\\dst\\win32\\t_dst.vcxproj.filters",
"..\\bin\\tests\\win32\\backtrace_test.vcxproj",
"..\\bin\\tests\\win32\\backtrace_test.vcxproj.filters",
"..\\bin\\tests\\win32\\inter_test.vcxproj",
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