From b61dfb77273abc9baa993eccd9725a194bdce837 Mon Sep 17 00:00:00 2001 From: lingsheng Date: Wed, 5 Aug 2020 17:04:52 +0800 Subject: [PATCH] Fix build with nss 3.54 --- ...NETSCAPE_-to-_NSS_-PKCS#11-constants.patch | 43 +++++++++++++++++++ jss.spec | 6 ++- 2 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 Move-from-_NETSCAPE_-to-_NSS_-PKCS#11-constants.patch diff --git a/Move-from-_NETSCAPE_-to-_NSS_-PKCS#11-constants.patch b/Move-from-_NETSCAPE_-to-_NSS_-PKCS#11-constants.patch new file mode 100644 index 0000000..7901450 --- /dev/null +++ b/Move-from-_NETSCAPE_-to-_NSS_-PKCS#11-constants.patch @@ -0,0 +1,43 @@ +From dd9fc06b9ba487cf982c8dbfd73c616754dbac0d Mon Sep 17 00:00:00 2001 +From: Alexander Scheel +Date: Tue, 7 Apr 2020 11:28:24 -0400 +Subject: [PATCH] Move from _NETSCAPE_ to _NSS_ PKCS#11 constants + +In NSS v3.52, support is coming for PKCS#11 v3.0. This deprecates the +_NETSCAPE_ namespace for PKCS#11 constants in favor of _NSS_. The few +remaining _NETSCAPE_ constants will be moved to _NSS_. We only use one, +CKM_NETSCAPE_PBE_SHA1_DES_CBC. Add an #ifdef for compatibility with the +new preferred name. + +See also: moz-bz#1603628 + +Signed-off-by: Alexander Scheel +--- + org/mozilla/jss/pkcs11/PK11SymKey.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/org/mozilla/jss/pkcs11/PK11SymKey.c b/org/mozilla/jss/pkcs11/PK11SymKey.c +index 8eaf9b77e..60a37c45b 100644 +--- a/org/mozilla/jss/pkcs11/PK11SymKey.c ++++ b/org/mozilla/jss/pkcs11/PK11SymKey.c +@@ -14,6 +14,11 @@ + #include + #include "pk11util.h" + ++/* For PKCS#11 v3.0 compatibility */ ++#ifndef CKM_NSS_PBE_SHA1_DES_CBC ++#define CKM_NSS_PBE_SHA1_DES_CBC (CKM_NETSCAPE_PBE_SHA1_DES_CBC) ++#endif ++ + /*********************************************************************** + * + * J S S _ P K 1 1 _ w r a p S y m K e y +@@ -262,7 +267,7 @@ Java_org_mozilla_jss_pkcs11_PK11SymKey_getKeyType + /* PBE mechanisms have to be handled by hand */ + case CKM_PBE_MD2_DES_CBC: + case CKM_PBE_MD5_DES_CBC: +- case CKM_NETSCAPE_PBE_SHA1_DES_CBC: ++ case CKM_NSS_PBE_SHA1_DES_CBC: + typeFieldName = DES_KEYTYPE_FIELD; + break; + case CKM_PBE_SHA1_RC4_128: diff --git a/jss.spec b/jss.spec index 551222c..2d342c5 100644 --- a/jss.spec +++ b/jss.spec @@ -3,9 +3,10 @@ Summary: Java Security Services URL: http://www.dogtagpki.org/wiki/JSS License: MPLv1.1 or GPLv2+ or LGPLv2+ Version: 4.6.2 -Release: 3 +Release: 4 Source: https://github.com/dogtagpki/jss/archive/v%{version}/jss-%{version}.tar.gz Patch0001: 0001-Fix-NativeProxy-reference-tracker.patch +Patch0002: Move-from-_NETSCAPE_-to-_NSS_-PKCS#11-constants.patch BuildRequires: git make cmake gcc-c++ nspr-devel >= 4.13.1 nss-devel >= 3.30 nss-tools >= 3.30 java-devel BuildRequires: jpackage-utils slf4j glassfish-jaxb-api slf4j-jdk14 apache-commons-lang apache-commons-codec @@ -78,5 +79,8 @@ cp -rp build/docs/* jss.html *.txt $RPM_BUILD_ROOT%{_javadocdir}/jss-%{version} %{_javadocdir}/jss-%{version}/ %changelog +* Wed Aug 05 2020 lingsheng - 4.6.2-4 +- Fix build with nss 3.54 + * Thu Apr 16 2020 lizhenhua - 4.6.2-3 - Package init