xref: /OK3568_Linux_fs/buildroot/package/pkcs11-helper/0001-nss-use-nss-pkcs11-h.patch (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593SmuzhiyunFrom d159a5c59c80552c3e8ea75d9bcf29b3a8e8289d Mon Sep 17 00:00:00 2001
2*4882a593SmuzhiyunFrom: Alon Bar-Lev <alon.barlev@gmail.com>
3*4882a593SmuzhiyunDate: Fri, 30 Jul 2021 20:06:36 +0300
4*4882a593SmuzhiyunSubject: [PATCH] nss: use nss pkcs11.h
5*4882a593Smuzhiyun
6*4882a593Smuzhiyunmake nss happy with its own extensions and non-standard behavior.
7*4882a593Smuzhiyun[Retrieved (and updated to remove ChangeLog update) from:
8*4882a593Smuzhiyunhttps://github.com/OpenSC/pkcs11-helper/pull/39]
9*4882a593SmuzhiyunSigned-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
10*4882a593Smuzhiyun---
11*4882a593Smuzhiyun ChangeLog                 |  1 +
12*4882a593Smuzhiyun lib/_pkcs11h-crypto-nss.c | 14 ++++++++++----
13*4882a593Smuzhiyun lib/common.h              |  7 +++++++
14*4882a593Smuzhiyun 3 files changed, 18 insertions(+), 4 deletions(-)
15*4882a593Smuzhiyun
16*4882a593Smuzhiyundiff --git a/lib/_pkcs11h-crypto-nss.c b/lib/_pkcs11h-crypto-nss.c
17*4882a593Smuzhiyunindex 4b70e826..f57f9e6b 100644
18*4882a593Smuzhiyun--- a/lib/_pkcs11h-crypto-nss.c
19*4882a593Smuzhiyun+++ b/lib/_pkcs11h-crypto-nss.c
20*4882a593Smuzhiyun@@ -48,15 +48,21 @@
21*4882a593Smuzhiyun  * POSSIBILITY OF SUCH DAMAGE.
22*4882a593Smuzhiyun  */
23*4882a593Smuzhiyun
24*4882a593Smuzhiyun-#include "common.h"
25*4882a593Smuzhiyun-
26*4882a593Smuzhiyun-#include "_pkcs11h-crypto.h"
27*4882a593Smuzhiyun+#ifdef HAVE_CONFIG_H
28*4882a593Smuzhiyun+#include <config.h>
29*4882a593Smuzhiyun+#endif
30*4882a593Smuzhiyun
31*4882a593Smuzhiyun #if defined(ENABLE_PKCS11H_ENGINE_NSS)
32*4882a593Smuzhiyun-#define _PKCS11T_H_ /* required so no conflict with ours */
33*4882a593Smuzhiyun #include <nss.h>
34*4882a593Smuzhiyun #include <cert.h>
35*4882a593Smuzhiyun
36*4882a593Smuzhiyun+/* Use PKCS#11 of nss to avoid conflicts and make nss happy with its own extensions */
37*4882a593Smuzhiyun+#define PKCS11_H 1
38*4882a593Smuzhiyun+
39*4882a593Smuzhiyun+#include "common.h"
40*4882a593Smuzhiyun+
41*4882a593Smuzhiyun+#include "_pkcs11h-crypto.h"
42*4882a593Smuzhiyun+
43*4882a593Smuzhiyun static
44*4882a593Smuzhiyun int
45*4882a593Smuzhiyun __pkcs11h_crypto_nss_initialize (
46*4882a593Smuzhiyundiff --git a/lib/common.h b/lib/common.h
47*4882a593Smuzhiyunindex 61a958af..2499e9c5 100644
48*4882a593Smuzhiyun--- a/lib/common.h
49*4882a593Smuzhiyun+++ b/lib/common.h
50*4882a593Smuzhiyun@@ -72,5 +72,12 @@
51*4882a593Smuzhiyun
52*4882a593Smuzhiyun #define _PKCS11H_ASSERT		assert
53*4882a593Smuzhiyun
54*4882a593Smuzhiyun+#ifndef FALSE
55*4882a593Smuzhiyun+#define FALSE 0
56*4882a593Smuzhiyun+#endif
57*4882a593Smuzhiyun+#ifndef TRUE
58*4882a593Smuzhiyun+#define TRUE 1
59*4882a593Smuzhiyun+#endif
60*4882a593Smuzhiyun+
61*4882a593Smuzhiyun #endif
62*4882a593Smuzhiyun
63