Blame SOURCES/bind-9.11-kyua-pkcs11.patch

854838
From 1241f2005d08673c28a595c5a6cd61350b95a929 Mon Sep 17 00:00:00 2001
854838
From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= <pemensik@redhat.com>
854838
Date: Tue, 2 Jan 2018 18:13:07 +0100
854838
Subject: [PATCH] Fix pkcs11 variants atf tests
854838
854838
Add dns-pkcs11 tests Makefile to configure
854838
854838
Add pkcs11 Kyuafile, fix dh_test to pass in pkcs11 mode
854838
---
854838
 configure.ac                   | 1 +
854838
 lib/Kyuafile                   | 2 ++
854838
 lib/dns-pkcs11/tests/dh_test.c | 3 ++-
854838
 3 files changed, 5 insertions(+), 1 deletion(-)
854838
854838
diff --git a/configure.ac b/configure.ac
854838
index d80ae31..0fb9328 100644
854838
--- a/configure.ac
854838
+++ b/configure.ac
854838
@@ -3090,6 +3090,7 @@ AC_CONFIG_FILES([
854838
 	lib/dns-pkcs11/include/Makefile
854838
 	lib/dns-pkcs11/include/dns/Makefile
854838
 	lib/dns-pkcs11/include/dst/Makefile
854838
+	lib/dns-pkcs11/tests/Makefile
854838
 	lib/irs/Makefile
854838
 	lib/irs/include/Makefile
854838
 	lib/irs/include/irs/Makefile
854838
diff --git a/lib/Kyuafile b/lib/Kyuafile
854838
index 39ce986..037e5ef 100644
854838
--- a/lib/Kyuafile
854838
+++ b/lib/Kyuafile
854838
@@ -2,8 +2,10 @@ syntax(2)
854838
 test_suite('bind9')
854838
 
854838
 include('dns/Kyuafile')
854838
+include('dns-pkcs11/Kyuafile')
854838
 include('irs/Kyuafile')
854838
 include('isc/Kyuafile')
854838
 include('isccc/Kyuafile')
854838
 include('isccfg/Kyuafile')
854838
 include('ns/Kyuafile')
854838
+include('ns-pkcs11/Kyuafile')
854838
diff --git a/lib/dns-pkcs11/tests/dh_test.c b/lib/dns-pkcs11/tests/dh_test.c
854838
index 934e8fd..658d1af 100644
854838
--- a/lib/dns-pkcs11/tests/dh_test.c
854838
+++ b/lib/dns-pkcs11/tests/dh_test.c
854838
@@ -87,7 +87,8 @@ dh_computesecret(void **state) {
854838
 	result = dst_key_computesecret(key, key, &buf;;
854838
 	assert_int_equal(result, DST_R_NOTPRIVATEKEY);
854838
 	result = key->func->computesecret(key, key, &buf;;
854838
-	assert_int_equal(result, DST_R_COMPUTESECRETFAILURE);
854838
+	/* PKCS11 variant gives different result, accept both */
854838
+	assert_true(result == DST_R_COMPUTESECRETFAILURE || result == DST_R_INVALIDPRIVATEKEY);
854838
 
854838
 	dst_key_free(&key);
854838
 }
854838
-- 
854838
2.20.1
854838