!8 upgrade to version 5.1.0

From: @wang--ge 
Reviewed-by: @zhuchunyi 
Signed-off-by: @zhuchunyi
This commit is contained in:
openeuler-ci-bot 2022-06-07 11:36:00 +00:00 committed by Gitee
commit 403cf24b75
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
5 changed files with 24 additions and 112 deletions

View File

@ -1,53 +0,0 @@
From 91514ca0a2979ba778d27220ced0cd312e2cd2d2 Mon Sep 17 00:00:00 2001
From: Alexander Scheel <ascheel@redhat.com>
Date: Tue, 29 Oct 2019 10:43:56 -0400
Subject: [PATCH] Fix NativeProxy reference tracker
In eb5df01003d74b57473eacb84e538d31f5bb06ca, I introduced a bug by
setting mPointer after trying to add NativeProxy to the registry. In
most instances this won't matter, however, if another instance exists in
the HashSet with the same hash value, the equals comparator will be
used, triggering a NPE.
Signed-off-by: Alexander Scheel <ascheel@redhat.com>
---
org/mozilla/jss/util/NativeProxy.java | 13 +++++--------
1 file changed, 5 insertions(+), 8 deletions(-)
diff --git a/org/mozilla/jss/util/NativeProxy.java b/org/mozilla/jss/util/NativeProxy.java
index 1c6d1aa5..a0811f76 100644
--- a/org/mozilla/jss/util/NativeProxy.java
+++ b/org/mozilla/jss/util/NativeProxy.java
@@ -40,8 +40,8 @@ public abstract class NativeProxy implements AutoCloseable
*/
public NativeProxy(byte[] pointer) {
assert(pointer!=null);
- registry.add(this);
mPointer = pointer;
+ registry.add(this);
if (saveStacktraces) {
mTrace = Arrays.toString(Thread.currentThread().getStackTrace());
@@ -61,15 +61,12 @@ public abstract class NativeProxy implements AutoCloseable
if( ! (obj instanceof NativeProxy) ) {
return false;
}
- if( ((NativeProxy)obj).mPointer.length != mPointer.length) {
+ if (((NativeProxy)obj).mPointer == null) {
+ /* If mPointer is null, we have no way to compare the values
+ * of the pointers, so assume they're unequal. */
return false;
}
- for(int i=0; i < mPointer.length; i++) {
- if(mPointer[i] != ((NativeProxy)obj).mPointer[i]) {
- return false;
- }
- }
- return true;
+ return Arrays.equals(((NativeProxy)obj).mPointer, mPointer);
}
/**
--
2.21.0

View File

@ -1,43 +0,0 @@
From dd9fc06b9ba487cf982c8dbfd73c616754dbac0d Mon Sep 17 00:00:00 2001
From: Alexander Scheel <ascheel@redhat.com>
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 <ascheel@redhat.com>
---
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 <jssutil.h>
#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:

Binary file not shown.

BIN
jss-5.1.0.tar.gz Normal file

Binary file not shown.

View File

@ -2,19 +2,21 @@ Name: jss
Summary: Java Security Services
URL: http://www.dogtagpki.org/wiki/JSS
License: MPLv1.1 or GPLv2+ or LGPLv2+
Version: 4.6.2
Release: 5
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
Version: 5.1.0
Release: 1
Source: https://github.com/dogtagpki/jss/archive/refs/tags/jss-%{version}.tar.gz
BuildRequires: 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
BuildRequires: junit
BuildRequires: zip unzip java-11-openjdk-devel apache-commons-lang3
Requires: nss >= 3.30 java-headless jpackage-utils slf4j glassfish-jaxb-api
Requires: slf4j-jdk14 apache-commons-lang apache-commons-codec
Requires: java-11-openjdk-headless apache-commons-lang3
Conflicts: ldapjdk < 4.20 idm-console-framework < 1.2 tomcatjss < 7.3.4 pki-base < 10.6.5
%description
@ -34,8 +36,8 @@ API documentation for JSS.
%build
%set_build_flags
[ -z "$JAVA_HOME" ] && export JAVA_HOME=%{_jvmdir}/java
home_path=`ls /usr/lib/jvm | grep java-11-openjdk`
[ -z "$JAVA_HOME" ] && export JAVA_HOME=%{_jvmdir}/${home_path}
export BUILD_OPT=1
@ -43,25 +45,28 @@ export CFLAGS="-g $RPM_OPT_FLAGS"
modutil -dbdir /etc/pki/nssdb -chkfips true | grep -q enabled && export FIPS_ENABLED=1
rm -rf build && install -d build && cd build
%cmake -DJAVA_HOME=%{java_home} -DJAVA_LIB_INSTALL_DIR=%{_jnidir} ..
%make_build all
%make_build javadoc || true
./build.sh \
%{?_verbose:-v} \
--work-dir=build \
--jni-dir=%{_jnidir} \
--lib-dir=%{_libdir} \
--version=%{version} \
dist
%install
mkdir -p $RPM_BUILD_ROOT%{_jnidir}
chmod 755 $RPM_BUILD_ROOT%{_jnidir}
cp build/jss4.jar ${RPM_BUILD_ROOT}%{_jnidir}
chmod 644 ${RPM_BUILD_ROOT}%{_jnidir}/jss4.jar
cp build/jss.jar ${RPM_BUILD_ROOT}%{_jnidir}
chmod 644 ${RPM_BUILD_ROOT}%{_jnidir}/jss.jar
mkdir -p $RPM_BUILD_ROOT%{_libdir}/jss
chmod 755 $RPM_BUILD_ROOT%{_libdir}/jss
cp build/libjss4.so ${RPM_BUILD_ROOT}%{_libdir}/jss
chmod 755 ${RPM_BUILD_ROOT}%{_libdir}/jss/libjss4.so
cp build/libjss.so ${RPM_BUILD_ROOT}%{_libdir}/jss
chmod 755 ${RPM_BUILD_ROOT}%{_libdir}/jss/libjss.so
pushd ${RPM_BUILD_ROOT}%{_libdir}/jss
ln -fs %{_jnidir}/jss4.jar jss4.jar
ln -fs %{_jnidir}/jss.jar jss.jar
popd
mkdir -p $RPM_BUILD_ROOT%{_javadocdir}/jss-%{version}
@ -79,6 +84,9 @@ cp -rp build/docs/* jss.html *.txt $RPM_BUILD_ROOT%{_javadocdir}/jss-%{version}
%{_javadocdir}/jss-%{version}/
%changelog
* Mon Jun 06 2022 Ge Wang <wangge20@h-partners.com> - 5.1.0-1
- Upgrade version to 5.1.0
* Fri Jul 30 2021 chenyanpanHW <chenyanpan@huawei.com> - 4.6.2-5
- DESC: delete -S git from %autosetup, and delete BuildRequires git