2019-07-23 14:18:58 +00:00
|
|
|
From c2e22d5b55fdc17cd51bf77980892e147c2b2ea1 Mon Sep 17 00:00:00 2001
|
2018-01-08 16:16:38 +00:00
|
|
|
From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= <pemensik@redhat.com>
|
|
|
|
Date: Tue, 2 Jan 2018 18:13:07 +0100
|
|
|
|
Subject: [PATCH] Fix pkcs11 variants atf tests
|
|
|
|
|
|
|
|
Add dns-pkcs11 tests Makefile to configure
|
|
|
|
|
|
|
|
Add pkcs11 Kyuafile, fix dh_test to pass in pkcs11 mode
|
|
|
|
---
|
2019-03-05 20:49:26 +00:00
|
|
|
configure.ac | 1 +
|
2018-01-08 16:16:38 +00:00
|
|
|
lib/Kyuafile | 2 ++
|
2019-07-23 13:18:22 +00:00
|
|
|
lib/dns-pkcs11/tests/Makefile.in | 12 ++++++------
|
2018-01-08 16:16:38 +00:00
|
|
|
lib/dns-pkcs11/tests/dh_test.c | 3 ++-
|
|
|
|
lib/isc-pkcs11/tests/Makefile.in | 6 +++---
|
2019-07-23 13:18:22 +00:00
|
|
|
5 files changed, 14 insertions(+), 10 deletions(-)
|
2018-01-08 16:16:38 +00:00
|
|
|
|
2019-03-05 20:49:26 +00:00
|
|
|
diff --git a/configure.ac b/configure.ac
|
2019-07-23 14:18:58 +00:00
|
|
|
index 0f7c850..0532e5f 100644
|
2019-03-05 20:49:26 +00:00
|
|
|
--- a/configure.ac
|
|
|
|
+++ b/configure.ac
|
2019-07-23 14:18:58 +00:00
|
|
|
@@ -3032,6 +3032,7 @@ AC_CONFIG_FILES([
|
2018-01-08 16:16:38 +00:00
|
|
|
lib/dns-pkcs11/include/Makefile
|
|
|
|
lib/dns-pkcs11/include/dns/Makefile
|
|
|
|
lib/dns-pkcs11/include/dst/Makefile
|
|
|
|
+ lib/dns-pkcs11/tests/Makefile
|
|
|
|
lib/irs/Makefile
|
|
|
|
lib/irs/include/Makefile
|
|
|
|
lib/irs/include/irs/Makefile
|
|
|
|
diff --git a/lib/Kyuafile b/lib/Kyuafile
|
2019-07-23 13:18:22 +00:00
|
|
|
index 39ce986..dcfb139 100644
|
2018-01-08 16:16:38 +00:00
|
|
|
--- a/lib/Kyuafile
|
|
|
|
+++ b/lib/Kyuafile
|
2019-03-05 20:49:26 +00:00
|
|
|
@@ -2,8 +2,10 @@ syntax(2)
|
2018-01-08 16:16:38 +00:00
|
|
|
test_suite('bind9')
|
|
|
|
|
|
|
|
include('dns/Kyuafile')
|
|
|
|
+include('dns-pkcs11/Kyuafile')
|
|
|
|
include('irs/Kyuafile')
|
|
|
|
include('isc/Kyuafile')
|
|
|
|
+include('isc-pkcs11/Kyuafile')
|
2019-03-05 20:49:26 +00:00
|
|
|
include('isccc/Kyuafile')
|
2018-01-08 16:16:38 +00:00
|
|
|
include('isccfg/Kyuafile')
|
2019-07-23 13:18:22 +00:00
|
|
|
include('ns/Kyuafile')
|
2018-01-08 16:16:38 +00:00
|
|
|
diff --git a/lib/dns-pkcs11/tests/Makefile.in b/lib/dns-pkcs11/tests/Makefile.in
|
2019-07-23 13:18:22 +00:00
|
|
|
index 7b35b93..c95d1c8 100644
|
2018-01-08 16:16:38 +00:00
|
|
|
--- a/lib/dns-pkcs11/tests/Makefile.in
|
|
|
|
+++ b/lib/dns-pkcs11/tests/Makefile.in
|
2019-07-23 13:18:22 +00:00
|
|
|
@@ -15,14 +15,14 @@ VERSION=@BIND9_VERSION@
|
2018-01-08 16:16:38 +00:00
|
|
|
|
2019-07-23 13:18:22 +00:00
|
|
|
@BIND9_MAKE_INCLUDES@
|
|
|
|
|
|
|
|
-CINCLUDES = -I. -Iinclude ${DNS_INCLUDES} ${ISC_INCLUDES} \
|
|
|
|
+CINCLUDES = -I. -Iinclude ${DNS_PKCS11_INCLUDES} ${ISC_PKCS11_INCLUDES} \
|
|
|
|
@OPENSSL_INCLUDES@ @CMOCKA_CFLAGS@
|
|
|
|
-CDEFINES = -DTESTS="\"${top_builddir}/lib/dns/tests/\""
|
|
|
|
+CDEFINES = -DTESTS="\"${top_builddir}/lib/dns-pkcs11/tests/\""
|
2018-01-08 16:16:38 +00:00
|
|
|
|
2019-07-23 13:18:22 +00:00
|
|
|
-ISCLIBS = ../../isc/libisc.@A@ @OPENSSL_LIBS@
|
2018-01-08 16:16:38 +00:00
|
|
|
-ISCDEPLIBS = ../../isc/libisc.@A@
|
2019-07-23 13:18:22 +00:00
|
|
|
-DNSLIBS = ../libdns.@A@ @DNS_CRYPTO_LIBS@
|
2018-01-08 16:16:38 +00:00
|
|
|
-DNSDEPLIBS = ../libdns.@A@
|
|
|
|
+ISCLIBS = ../../isc-pkcs11/libisc-pkcs11.@A@
|
|
|
|
+ISCDEPLIBS = ../../isc-pkcs11/libisc-pkcs11.@A@
|
2019-07-23 13:18:22 +00:00
|
|
|
+DNSLIBS = ../libdns-pkcs11.@A@ @DNS_CRYPTO_LIBS@
|
2018-01-08 16:16:38 +00:00
|
|
|
+DNSDEPLIBS = ../libdns-pkcs11.@A@
|
|
|
|
|
2019-03-05 20:49:26 +00:00
|
|
|
LIBS = @LIBS@ @CMOCKA_LIBS@
|
2019-07-23 13:18:22 +00:00
|
|
|
|
2018-01-08 16:16:38 +00:00
|
|
|
diff --git a/lib/dns-pkcs11/tests/dh_test.c b/lib/dns-pkcs11/tests/dh_test.c
|
2019-07-23 13:18:22 +00:00
|
|
|
index d83d9f5..d5bda29 100644
|
2018-01-08 16:16:38 +00:00
|
|
|
--- a/lib/dns-pkcs11/tests/dh_test.c
|
|
|
|
+++ b/lib/dns-pkcs11/tests/dh_test.c
|
2019-07-23 13:18:22 +00:00
|
|
|
@@ -85,7 +85,8 @@ dh_computesecret(void **state) {
|
2019-03-05 20:49:26 +00:00
|
|
|
result = dst_key_computesecret(key, key, &buf);
|
|
|
|
assert_int_equal(result, DST_R_NOTPRIVATEKEY);
|
|
|
|
result = key->func->computesecret(key, key, &buf);
|
|
|
|
- assert_int_equal(result, DST_R_COMPUTESECRETFAILURE);
|
2018-01-08 16:16:38 +00:00
|
|
|
+ /* PKCS11 variant gives different result, accept both */
|
2019-03-05 20:49:26 +00:00
|
|
|
+ assert_true(result == DST_R_COMPUTESECRETFAILURE || result == DST_R_INVALIDPRIVATEKEY);
|
2018-01-08 16:16:38 +00:00
|
|
|
|
|
|
|
dst_key_free(&key);
|
2019-03-05 20:49:26 +00:00
|
|
|
}
|
2018-01-08 16:16:38 +00:00
|
|
|
diff --git a/lib/isc-pkcs11/tests/Makefile.in b/lib/isc-pkcs11/tests/Makefile.in
|
2019-07-23 14:18:58 +00:00
|
|
|
index 7e62737..e91cd67 100644
|
2018-01-08 16:16:38 +00:00
|
|
|
--- a/lib/isc-pkcs11/tests/Makefile.in
|
|
|
|
+++ b/lib/isc-pkcs11/tests/Makefile.in
|
2019-07-23 14:18:58 +00:00
|
|
|
@@ -15,11 +15,11 @@ VERSION=@BIND9_VERSION@
|
|
|
|
|
2018-01-08 16:16:38 +00:00
|
|
|
@BIND9_MAKE_INCLUDES@
|
|
|
|
|
2019-07-23 14:18:58 +00:00
|
|
|
-CINCLUDES = -I. -Iinclude ${ISC_INCLUDES} @OPENSSL_INCLUDES@ @CMOCKA_CFLAGS@
|
2019-07-23 13:18:22 +00:00
|
|
|
-CDEFINES = -DTESTS="\"${top_builddir}/lib/isc/tests/\""
|
2019-07-23 14:18:58 +00:00
|
|
|
+CINCLUDES = -I. -Iinclude ${ISC_PKCS11_INCLUDES} @OPENSSL_INCLUDES@ @CMOCKA_CFLAGS@
|
2019-07-23 13:18:22 +00:00
|
|
|
+CDEFINES = -DTESTS="\"${top_builddir}/lib/isc-pkcs11/tests/\""
|
2018-01-08 16:16:38 +00:00
|
|
|
|
2019-07-23 14:18:58 +00:00
|
|
|
ISCLIBS = ../libisc-pkcs11.@A@ @OPENSSL_LIBS@
|
2018-01-08 16:16:38 +00:00
|
|
|
-ISCDEPLIBS = ../libisc.@A@
|
|
|
|
+ISCDEPLIBS = ../libisc-pkcs11.@A@
|
|
|
|
|
2019-03-05 20:49:26 +00:00
|
|
|
LIBS = @LIBS@ @CMOCKA_LIBS@
|
2018-01-08 16:16:38 +00:00
|
|
|
|
|
|
|
--
|
2019-03-05 20:49:26 +00:00
|
|
|
2.20.1
|
2018-01-08 16:16:38 +00:00
|
|
|
|