archrelease: copy trunk to extra-x86_64
[arch-packages.git] / pkcs11-helper / trunk / 0001-nss-use-nss-pkcs11-h.patch
blob8ac86cc9f730bfe9bab873fc52ed57c47a828341
1 From 083a3a62f2e631deec2fb2799d10660a41c50294 Mon Sep 17 00:00:00 2001
2 From: Alon Bar-Lev <alon.barlev@gmail.com>
3 Date: Fri, 30 Jul 2021 20:06:36 +0300
4 Subject: [PATCH] nss: use nss pkcs11.h
6 make nss happy with its own extensions and non-standard behavior.
7 ---
8 lib/_pkcs11h-crypto-nss.c | 14 ++++++++++----
9 lib/common.h | 7 +++++++
10 2 files changed, 17 insertions(+), 4 deletions(-)
12 diff --git a/lib/_pkcs11h-crypto-nss.c b/lib/_pkcs11h-crypto-nss.c
13 index 4b70e826..f57f9e6b 100644
14 --- a/lib/_pkcs11h-crypto-nss.c
15 +++ b/lib/_pkcs11h-crypto-nss.c
16 @@ -48,15 +48,21 @@
17 * POSSIBILITY OF SUCH DAMAGE.
20 -#include "common.h"
22 -#include "_pkcs11h-crypto.h"
23 +#ifdef HAVE_CONFIG_H
24 +#include <config.h>
25 +#endif
27 #if defined(ENABLE_PKCS11H_ENGINE_NSS)
28 -#define _PKCS11T_H_ /* required so no conflict with ours */
29 #include <nss.h>
30 #include <cert.h>
32 +/* Use PKCS#11 of nss to avoid conflicts and make nss happy with its own extensions */
33 +#define PKCS11_H 1
35 +#include "common.h"
37 +#include "_pkcs11h-crypto.h"
39 static
40 int
41 __pkcs11h_crypto_nss_initialize (
42 diff --git a/lib/common.h b/lib/common.h
43 index 61a958af..2499e9c5 100644
44 --- a/lib/common.h
45 +++ b/lib/common.h
46 @@ -72,5 +72,12 @@
48 #define _PKCS11H_ASSERT assert
50 +#ifndef FALSE
51 +#define FALSE 0
52 +#endif
53 +#ifndef TRUE
54 +#define TRUE 1
55 +#endif
57 #endif