bind/bind-9.11-kyua-pkcs11.patch

59 lines
1.8 KiB
Diff
Raw Normal View History

2021-12-04 15:31:20 +08:00
From 1241f2005d08673c28a595c5a6cd61350b95a929 Mon Sep 17 00:00:00 2001
2019-12-28 09:41:34 +08: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
---
2021-12-04 15:31:20 +08:00
configure.ac | 1 +
lib/Kyuafile | 2 ++
lib/dns-pkcs11/tests/dh_test.c | 3 ++-
3 files changed, 5 insertions(+), 1 deletion(-)
2019-12-28 09:41:34 +08:00
2020-07-27 17:33:59 +08:00
diff --git a/configure.ac b/configure.ac
2021-12-04 15:31:20 +08:00
index d80ae31..0fb9328 100644
2020-07-27 17:33:59 +08:00
--- a/configure.ac
+++ b/configure.ac
2021-12-04 15:31:20 +08:00
@@ -3090,6 +3090,7 @@ AC_CONFIG_FILES([
2019-12-28 09:41:34 +08: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
2021-12-04 15:31:20 +08:00
index 39ce986..037e5ef 100644
2019-12-28 09:41:34 +08:00
--- a/lib/Kyuafile
+++ b/lib/Kyuafile
2020-07-27 17:33:59 +08:00
@@ -2,8 +2,10 @@ syntax(2)
2019-12-28 09:41:34 +08:00
test_suite('bind9')
include('dns/Kyuafile')
+include('dns-pkcs11/Kyuafile')
include('irs/Kyuafile')
include('isc/Kyuafile')
2020-07-27 17:33:59 +08:00
include('isccc/Kyuafile')
2019-12-28 09:41:34 +08:00
include('isccfg/Kyuafile')
2021-12-04 15:31:20 +08:00
include('ns/Kyuafile')
+include('ns-pkcs11/Kyuafile')
2019-12-28 09:41:34 +08:00
diff --git a/lib/dns-pkcs11/tests/dh_test.c b/lib/dns-pkcs11/tests/dh_test.c
2021-12-04 15:31:20 +08:00
index 934e8fd..658d1af 100644
2019-12-28 09:41:34 +08:00
--- a/lib/dns-pkcs11/tests/dh_test.c
+++ b/lib/dns-pkcs11/tests/dh_test.c
2021-12-04 15:31:20 +08:00
@@ -87,7 +87,8 @@ dh_computesecret(void **state) {
2020-07-27 17:33:59 +08: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);
2019-12-28 09:41:34 +08:00
+ /* PKCS11 variant gives different result, accept both */
2020-07-27 17:33:59 +08:00
+ assert_true(result == DST_R_COMPUTESECRETFAILURE || result == DST_R_INVALIDPRIVATEKEY);
2019-12-28 09:41:34 +08:00
dst_key_free(&key);
2020-07-27 17:33:59 +08:00
}
2019-12-28 09:41:34 +08:00
--
2021-12-04 15:31:20 +08:00
2.20.1
2019-12-28 09:41:34 +08:00