2020-06-18 02:08:57 +00:00
|
|
|
From c42c0ff6f6e0e920356d99b9ed26ed52544621c2 Mon Sep 17 00:00:00 2001
|
2019-10-18 20:35:56 +00:00
|
|
|
From: Petr Mensik <pemensik@redhat.com>
|
|
|
|
Date: Fri, 18 Oct 2019 21:30:52 +0200
|
|
|
|
Subject: [PATCH] Move USE_PKCS11 and USE_OPENSSL out of config.h
|
|
|
|
|
|
|
|
Building two variants with the same common code requires to unset
|
|
|
|
USE_PKCS11 on part of build. That is not possible with config.h value.
|
|
|
|
Move it as normal define to CDEFINES.
|
|
|
|
---
|
2019-10-18 23:51:12 +00:00
|
|
|
bin/confgen/Makefile.in | 2 +-
|
|
|
|
configure.ac | 8 ++++++--
|
|
|
|
lib/dns/dst_internal.h | 12 +++++++++---
|
2020-04-27 19:59:25 +00:00
|
|
|
3 files changed, 16 insertions(+), 6 deletions(-)
|
2019-10-18 20:35:56 +00:00
|
|
|
|
|
|
|
diff --git a/bin/confgen/Makefile.in b/bin/confgen/Makefile.in
|
2020-06-18 02:08:57 +00:00
|
|
|
index 1b7512d..c126bf3 100644
|
2019-10-18 20:35:56 +00:00
|
|
|
--- a/bin/confgen/Makefile.in
|
|
|
|
+++ b/bin/confgen/Makefile.in
|
|
|
|
@@ -22,7 +22,7 @@ VERSION=@BIND9_VERSION@
|
|
|
|
CINCLUDES = -I${srcdir}/include ${ISC_INCLUDES} ${ISCCC_INCLUDES} \
|
|
|
|
${ISCCFG_INCLUDES} ${DNS_INCLUDES} ${BIND9_INCLUDES}
|
|
|
|
|
|
|
|
-CDEFINES =
|
|
|
|
+CDEFINES = @USE_PKCS11@
|
|
|
|
CWARNINGS =
|
|
|
|
|
|
|
|
ISCCFGLIBS = ../../lib/isccfg/libisccfg.@A@
|
|
|
|
diff --git a/configure.ac b/configure.ac
|
2020-06-18 02:08:57 +00:00
|
|
|
index eaa6b12..2ff68a5 100644
|
2019-10-18 20:35:56 +00:00
|
|
|
--- a/configure.ac
|
|
|
|
+++ b/configure.ac
|
2020-06-18 02:08:57 +00:00
|
|
|
@@ -900,10 +900,14 @@ AC_SUBST([PKCS11_TEST])
|
2019-10-18 20:35:56 +00:00
|
|
|
AC_SUBST([PKCS11_TOOLS])
|
2020-06-18 02:08:57 +00:00
|
|
|
AC_SUBST([PKCS11_MANS])
|
2019-10-18 20:35:56 +00:00
|
|
|
|
2019-10-18 23:51:12 +00:00
|
|
|
+USE_PKCS11='-DUSE_PKCS11=0'
|
|
|
|
+USE_OPENSSL='-DUSE_OPENSSL=0'
|
2020-05-20 11:25:26 +00:00
|
|
|
AC_SUBST([CRYPTO])
|
2019-10-18 20:35:56 +00:00
|
|
|
AS_CASE([$CRYPTO],
|
|
|
|
- [pkcs11],[AC_DEFINE([USE_PKCS11], [1], [define if PKCS11 is used for Public-Key Cryptography])],
|
|
|
|
- [AC_DEFINE([USE_OPENSSL], [1], [define if OpenSSL is used for Public-Key Cryptography])])
|
2019-10-18 23:51:12 +00:00
|
|
|
+ [pkcs11],[USE_PKCS11='-DUSE_PKCS11=1'],
|
|
|
|
+ [USE_OPENSSL='-DUSE_OPENSSL=1'])
|
2019-10-18 20:35:56 +00:00
|
|
|
+AC_SUBST(USE_PKCS11)
|
|
|
|
+AC_SUBST(USE_OPENSSL)
|
|
|
|
|
|
|
|
# preparation for automake
|
|
|
|
# AM_CONDITIONAL([PKCS11_TOOLS], [test "$with_native_pkcs11" = "yes"])
|
2019-10-18 23:51:12 +00:00
|
|
|
diff --git a/lib/dns/dst_internal.h b/lib/dns/dst_internal.h
|
2020-05-20 11:25:26 +00:00
|
|
|
index 116e2d2..99bdf5b 100644
|
2019-10-18 23:51:12 +00:00
|
|
|
--- a/lib/dns/dst_internal.h
|
|
|
|
+++ b/lib/dns/dst_internal.h
|
2020-04-27 19:59:25 +00:00
|
|
|
@@ -38,6 +38,13 @@
|
2019-10-18 23:51:12 +00:00
|
|
|
#include <isc/stdtime.h>
|
2020-04-27 19:59:25 +00:00
|
|
|
#include <isc/types.h>
|
2019-10-18 23:51:12 +00:00
|
|
|
|
|
|
|
+#ifndef USE_PKCS11
|
|
|
|
+#define USE_PKCS11 0
|
|
|
|
+#endif
|
2020-04-27 19:59:25 +00:00
|
|
|
+#ifndef USE_OPENSSL
|
|
|
|
+#define USE_OPENSSL (! USE_PKCS11)
|
|
|
|
+#endif
|
2019-10-18 23:51:12 +00:00
|
|
|
+
|
|
|
|
#if USE_PKCS11
|
|
|
|
#include <pk11/pk11.h>
|
|
|
|
#include <pk11/site.h>
|
2020-04-27 19:59:25 +00:00
|
|
|
@@ -98,11 +105,10 @@ struct dst_key {
|
2019-10-18 23:51:12 +00:00
|
|
|
void *generic;
|
|
|
|
gss_ctx_id_t gssctx;
|
|
|
|
DH *dh;
|
|
|
|
-#if USE_OPENSSL
|
|
|
|
- EVP_PKEY *pkey;
|
2020-04-27 19:59:25 +00:00
|
|
|
-#endif /* if USE_OPENSSL */
|
2019-10-18 23:51:12 +00:00
|
|
|
#if USE_PKCS11
|
|
|
|
pk11_object_t *pkey;
|
|
|
|
+#else
|
|
|
|
+ EVP_PKEY *pkey;
|
2020-04-27 19:59:25 +00:00
|
|
|
#endif /* if USE_PKCS11 */
|
2019-10-18 23:51:12 +00:00
|
|
|
dst_hmac_key_t *hmac_key;
|
2020-04-27 19:59:25 +00:00
|
|
|
} keydata; /*%< pointer to key in crypto pkg fmt */
|
2019-10-18 20:35:56 +00:00
|
|
|
--
|
2020-06-18 02:08:57 +00:00
|
|
|
2.26.2
|
2019-10-18 20:35:56 +00:00
|
|
|
|