Commit 83dbe04b authored by Ondřej Surý's avatar Ondřej Surý

Update dst_test.c to use ECDSA256 and RSASHA256 as test algorithms

parent fbb08b30
......@@ -19,6 +19,7 @@
#include <unistd.h>
#include <isc/file.h>
#include <isc/hex.h>
#include <isc/util.h>
#include <isc/stdio.h>
#include <isc/string.h>
......@@ -185,10 +186,39 @@ check_sig(const char *datapath, const char *sigpath, const char *keyname,
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
result = dst_context_verify(ctx, &sigreg);
if (expect && result != ISC_R_SUCCESS) {
isc_result_t result2;
result2 = dst_context_create(key, mctx, DNS_LOGCATEGORY_GENERAL,
false, 0, &ctx);
ATF_REQUIRE_EQ(result2, ISC_R_SUCCESS);
result2 = dst_context_adddata(ctx, &datareg);
ATF_REQUIRE_EQ(result2, ISC_R_SUCCESS);
char sigbuf2[4096];
isc_buffer_t sigb;
isc_buffer_init(&sigb, sigbuf2, sizeof(sigbuf2));
result2 = dst_context_sign(ctx, &sigb);
ATF_REQUIRE_EQ(result2, ISC_R_SUCCESS);
isc_region_t r;
isc_buffer_usedregion(&sigb, &r);
char hexbuf[4096] = { 0 };
isc_buffer_t hb;
isc_buffer_init(&hb, hexbuf, sizeof(hexbuf));
isc_hex_totext(&r, 0, "", &hb);
fprintf(stderr, "%s\n", hexbuf);
dst_context_destroy(&ctx);
}
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);
......@@ -211,27 +241,28 @@ ATF_TC_BODY(sig, tc) {
dns_secalg_t alg;
bool expect;
} testcases[] = {
/* XXXOND: Why the heck isn't this failing? */
{
"testdata/dst/test1.data",
"testdata/dst/test1.dsasig",
"test.", 23616, DST_ALG_DSA, true
"testdata/dst/test1.ecdsa256sig",
"test.", 49130, DST_ALG_ECDSA256, true
},
{
"testdata/dst/test1.data",
"testdata/dst/test1.rsasig",
"test.", 54622, DST_ALG_RSAMD5, true
"testdata/dst/test1.rsasha256sig",
"test.", 11349, DST_ALG_RSASHA256, true
},
{
/* wrong sig */
"testdata/dst/test1.data",
"testdata/dst/test1.dsasig",
"test.", 54622, DST_ALG_RSAMD5, false
"testdata/dst/test1.ecdsa256sig",
"test.", 11349, DST_ALG_RSASHA256, false
},
{
/* wrong data */
"testdata/dst/test2.data",
"testdata/dst/test1.dsasig",
"test.", 23616, DST_ALG_DSA, false
"testdata/dst/test1.ecdsa256sig",
"test.", 49130, DST_ALG_ECDSA256, false
},
};
unsigned int i;
......
test. IN DNSKEY 257 3 1 AQPQjwSpaVzxIgRCpiUoozUQKGh2oX8NIFKDOvtxK+tn536OZg2cROKTlgGEHXJK9YHfW/6nzQULTVpb63P+SQMmjCCidb8IYyhItixRztVeJQ==
Private-key-format: v1.2
Algorithm: 1 (RSA)
Modulus: 0I8EqWlc8SIEQqYlKKM1EChodqF/DSBSgzr7cSvrZ+d+jmYNnETik5YBhB1ySvWB31v+p80FC01aW+tz/kkDJowgonW/CGMoSLYsUc7VXiU=
PublicExponent: Aw==
PrivateExponent: iwoDG5uTS2wC1xluGxd4tXBFpGuqCMA3AidSS3Kc7++ptEQJEtiXC9kfCJMvZhGfQLaujft2OgrmkcuDVtPIbQWEENhyJhb4Lk82kFXbfus=
Prime1: /rSKuzcZY7R5cY2YWD4CiBNyj9WJMq1wWmBnb9+5M08nTl5E9NW5qQ==
Prime2: 0Z5shXQYd16E2Gs6e5WxtO0Oqlly2KkSqXohwTQWDWTb8Pw0WTZmHQ==
Exponent1: qc2x0iS7l82mS7O65X6sWrehtTkGIcj1kZWaSpUmIjTE3umDTePRGw==
Exponent2: i77zA6K6+j8DOvIm/Q52eJ4JxuZMkHC3G6bBK3gOs5iSoKgi5iREEw==
Coefficient: 3+wYZB0SJad7z2EsjzgbSlg6CawoaOvrROGSbwSiW5DCsMFROudOTw==
test. IN DNSKEY 16641 3 3 ANp1//lqDlEfTavcFI+cyudNfgEz73V/K7fSDvkA0eDYcGg/kSvEjAEO/oLWCERltkuC55ZcM/mSv17WF1d/wR6kww/pLI9eXwkjftAYqs5sNxk+mbEGl6zwve9wq5z7IoTY5/J4l7XLCKftg/wGvrzXQhggIkRvEh3myhxd+ouILcpfvTIthWlTKiH59tSJpmgmiSMTE7nDYaf10iVRWN6DMSprgejiH05/fpmyZAt44tyAh4m1wXS5u4tam1PXDJYJozn7EfQ8e2weIv1yC+t6PHSx
Private-key-format: v1.2
Algorithm: 3 (DSA)
Prime(p): 73V/K7fSDvkA0eDYcGg/kSvEjAEO/oLWCERltkuC55ZcM/mSv17WF1d/wR6kww/pLI9eXwkjftAYqs5sNxk+mQ==
Subprime(q): 2nX/+WoOUR9Nq9wUj5zK501+ATM=
Base(g): sQaXrPC973CrnPsihNjn8niXtcsIp+2D/Aa+vNdCGCAiRG8SHebKHF36i4gtyl+9Mi2FaVMqIfn21ImmaCaJIw==
Private_value(x): Nky4tvIwg6xlcyeHXr4k2DEZg0E=
Public_value(y): ExO5w2Gn9dIlUVjegzEqa4Ho4h9Of36ZsmQLeOLcgIeJtcF0ubuLWptT1wyWCaM5+xH0PHtsHiL9cgvrejx0sQ==
; This is a zone-signing key, keyid 11349, for test.
; Created: 20181025090713 (Thu Oct 25 11:07:13 2018)
; Publish: 20181025090713 (Thu Oct 25 11:07:13 2018)
; Activate: 20181025090713 (Thu Oct 25 11:07:13 2018)
test. IN DNSKEY 256 3 8 AwEAAdqPwPScyURzeCUzEadKNYgQW50LPDV/ir9nWIbiSn2yMkymxiby BQH+Hk1neE9qa9X4XaEnKf5YZx7o14rRikmOb2lomtOkI9ovh1K/SvLO Zd1E3e61F29g1eCq52mMY3xAdEcBNqEq+6mgEwGmwl83+mAh5anxXNHa 2rcfdG+L
Private-key-format: v1.3
Algorithm: 8 (RSASHA256)
Modulus: 2o/A9JzJRHN4JTMRp0o1iBBbnQs8NX+Kv2dYhuJKfbIyTKbGJvIFAf4eTWd4T2pr1fhdoScp/lhnHujXitGKSY5vaWia06Qj2i+HUr9K8s5l3UTd7rUXb2DV4KrnaYxjfEB0RwE2oSr7qaATAabCXzf6YCHlqfFc0dratx90b4s=
PublicExponent: AQAB
PrivateExponent: a4qmX/YxlmvWpz8spYr/MhcSbQCVPKGoLKv2RFBeZODknRDGmW0mh6d5U47hBPqRWvRdZak2oX7wJqZdQGIAT25bC09rLNMctfxXKtzwSaXFjXZGHGv+bDHcqIltvIYmRbb0pK/LinFaLZqfpVe0WOfKuT9BT03BlwSZV8GKgZE=
Prime1: 8oZLQoVpIqsiQw7bX5pTm/O0gEUnEzNOVEoLGsfIl68Lz/1CBm9ypTp8QOB0B9IpnH8vOS+NJM1az1d0RhqKow==
Prime2: 5rSbE6duWIb90uICkAUJn4OztHX0fkd9GKNYdsHVReFBH2poXGojVGkW6i/IaYl4NEXXr5Z89dWtR+RNH2Z9+Q==
Exponent1: 2IcuCmYyR9Gi9Vv+YIzYuRQMw7j5+hqEhJzW7UIRxdtzIG9s03INWZet9/5tmc35eM/Uyam6ynDN8vCRz0VDIQ==
Exponent2: vKcdVKIKWrvwXXzRaaGk79rLnZsDFiwxQG96TIpOczkyfpUNx9xHDaRtx4zRTnPKZrxiFkRx5LkZXHt1EWNHSQ==
Coefficient: pb9dFRZA2IRXDCGCM1ikp+QCs72wNn3hgURZLRLmtcBbQcYhP/dcp80SpInviwJPNRcKrfxninqygEARzfHtqQ==
Created: 20181025090713
Publish: 20181025090713
Activate: 20181025090713
; This is a zone-signing key, keyid 49130, for test.
; Created: 20181025090718 (Thu Oct 25 11:07:18 2018)
; Publish: 20181025090718 (Thu Oct 25 11:07:18 2018)
; Activate: 20181025090718 (Thu Oct 25 11:07:18 2018)
test. IN DNSKEY 256 3 13 uP04fwB/DuBBqdjPLseIoFT7vgtP8Lr/be1NhRBvibwQ+Hr+3GQhIKIK XbamgOUxXJ9JDjWFAT2KXw0V3sAN9w==
Private-key-format: v1.3
Algorithm: 13 (ECDSAP256SHA256)
PrivateKey: feGDRABRCbcsCqssKK5B5518y95smrv/cJnz2pa/UVA=
Created: 20181025090718
Publish: 20181025090718
Activate: 20181025090718
0009B55FDB62034326278C9371F32D92
3D0E1161A32D491BEC38546FC452D903
A91D806345B2F7F22E
8A7D4670BCC3DC8299E62AAE0A2DCB84E5B972BC8CB97422DD61E58B74440645626CC11D421570745B2D84EE38DA64BBF27DEF66F951B88A3647BFE3730EADE5
65DE879EDCD21C9B22BDF383424C3F513C15A4F217FF2BEE555D1AE31E24C9FF5BBA1CB32A331C2236FC4FAFBD80F597E7CF6B19DB867FB75DC4AD41F8FA66D13D8B44F6B2A44624A88EAE168A8E3DB5E32946868BFD2BB3D562E85C492A89B1A93279B8B73D4785C09DFCE54485914B2BCDA5C537A842AAA2D3B2E5228E8A11
A8A20D2F26F792B3CE76DD0E12A85DFE
FF66AB866EF0BDB0F515001E234E699B
F5CD6FB41FB15D4213705ABE9B563896
2196228648E0F8AA7F2F4EED3C19165C
1B4C70C9D69B93A1F2BE5B2F948CE023
......@@ -327,7 +327,7 @@
./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/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
......@@ -3221,15 +3221,13 @@
./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/Ktest.+008+11349.key X 2018
./lib/dns/tests/testdata/dst/Ktest.+008+11349.private X 2018
./lib/dns/tests/testdata/dst/Ktest.+013+49130.key X 2018
./lib/dns/tests/testdata/dst/Ktest.+013+49130.private 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/test1.ecdsa256sig X 2018
./lib/dns/tests/testdata/dst/test1.rsasha256sig 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/master1.data X 2011,2018
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment