From c9daa15e9d8c92415b68f6f14bac365bb0294536 Mon Sep 17 00:00:00 2001 From: Jacek Konieczny Date: Mon, 26 Jan 2015 13:11:33 +0100 Subject: [PATCH] Version: 2.5.4 icedtea7-bug-2123.patch, icedtea7-bug-2135.patch applied upstream. --- icedtea7-bug-2123.patch | 180 ----------------------------------- icedtea7-bug-2135.patch | 202 ---------------------------------------- icedtea7.spec | 32 +++---- 3 files changed, 14 insertions(+), 400 deletions(-) delete mode 100644 icedtea7-bug-2123.patch delete mode 100644 icedtea7-bug-2135.patch diff --git a/icedtea7-bug-2123.patch b/icedtea7-bug-2123.patch deleted file mode 100644 index 502ffdc..0000000 --- a/icedtea7-bug-2123.patch +++ /dev/null @@ -1,180 +0,0 @@ - -# HG changeset patch -# User andrew -# Date 1417748009 0 -# Node ID 9665966de2e7d56cc437c9a8965ef43df2fb6168 -# Parent 899ad74ad3039f31f8d21087d00e3b33b91443a5 -PR2123: SunEC provider crashes when built using system NSS - -diff -r 899ad74ad303 -r 9665966de2e7 src/share/native/sun/security/ec/ECC_JNI.cpp ---- openjdk/jdk/src/share/native/sun/security/ec/ECC_JNI.cpp Thu Dec 04 20:38:07 2014 +0000 -+++ openjdk/jdk/src/share/native/sun/security/ec/ECC_JNI.cpp Fri Dec 05 02:53:29 2014 +0000 -@@ -32,6 +32,13 @@ - #define INVALID_PARAMETER_EXCEPTION \ - "java/security/InvalidParameterException" - #define KEY_EXCEPTION "java/security/KeyException" -+#define INTERNAL_ERROR "java/lang/InternalError" -+ -+#ifdef SYSTEM_NSS -+#define SYSTEM_UNUSED(x) UNUSED(x) -+#else -+#define SYSTEM_UNUSED(x) x -+#endif - - extern "C" { - -@@ -47,8 +54,13 @@ - /* - * Deep free of the ECParams struct - */ --void FreeECParams(ECParams *ecparams, jboolean freeStruct) -+void FreeECParams(ECParams *ecparams, jboolean SYSTEM_UNUSED(freeStruct)) - { -+#ifdef SYSTEM_NSS -+ // Needs to be freed using the matching method to the one -+ // that allocated it. PR_TRUE means the memory is zeroed. -+ PORT_FreeArena(ecparams->arena, PR_TRUE); -+#else - // Use B_FALSE to free the SECItem->data element, but not the SECItem itself - // Use B_TRUE to free both - -@@ -62,7 +74,7 @@ - SECITEM_FreeItem(&ecparams->curveOID, B_FALSE); - if (freeStruct) - free(ecparams); -- -+#endif - } - - jbyteArray getEncodedBytes(JNIEnv *env, SECItem *hSECItem) -@@ -104,6 +116,13 @@ - params_item.data = - (unsigned char *) env->GetByteArrayElements(encodedParams, 0); - -+#ifdef SYSTEM_NSS -+ if (SECOID_Init() != SECSuccess) { -+ ThrowException(env, INTERNAL_ERROR); -+ goto cleanup; -+ } -+#endif -+ - // Fill a new ECParams using the supplied OID - if (EC_DecodeParams(¶ms_item, &ecparams, 0) != SECSuccess) { - /* bad curve OID */ -@@ -159,6 +178,11 @@ - if (params_item.data) { - env->ReleaseByteArrayElements(encodedParams, - (jbyte *) params_item.data, JNI_ABORT); -+#ifdef SYSTEM_NSS -+ if (SECOID_Shutdown() != SECSuccess) { -+ ThrowException(env, INTERNAL_ERROR); -+ } -+#endif - } - - if (ecparams) { -@@ -167,10 +191,15 @@ - - if (privKey) { - FreeECParams(&privKey->ecParams, false); -+#ifndef SYSTEM_NSS -+ // The entire ECPrivateKey is allocated in the arena -+ // when using system NSS, so only the in-tree version -+ // needs to clear these manually. - SECITEM_FreeItem(&privKey->version, B_FALSE); - SECITEM_FreeItem(&privKey->privateValue, B_FALSE); - SECITEM_FreeItem(&privKey->publicValue, B_FALSE); - free(privKey); -+#endif - } - - if (pSeedBuffer) { -@@ -217,6 +246,13 @@ - params_item.data = - (unsigned char *) env->GetByteArrayElements(encodedParams, 0); - -+#ifdef SYSTEM_NSS -+ if (SECOID_Init() != SECSuccess) { -+ ThrowException(env, INTERNAL_ERROR); -+ goto cleanup; -+ } -+#endif -+ - // Fill a new ECParams using the supplied OID - if (EC_DecodeParams(¶ms_item, &ecparams, 0) != SECSuccess) { - /* bad curve OID */ -@@ -258,6 +294,11 @@ - if (params_item.data) { - env->ReleaseByteArrayElements(encodedParams, - (jbyte *) params_item.data, JNI_ABORT); -+#ifdef SYSTEM_NSS -+ if (SECOID_Shutdown() != SECSuccess) { -+ ThrowException(env, INTERNAL_ERROR); -+ } -+#endif - } - - if (privKey.privateValue.data) { -@@ -326,6 +367,13 @@ - params_item.data = - (unsigned char *) env->GetByteArrayElements(encodedParams, 0); - -+#ifdef SYSTEM_NSS -+ if (SECOID_Init() != SECSuccess) { -+ ThrowException(env, INTERNAL_ERROR); -+ goto cleanup; -+ } -+#endif -+ - // Fill a new ECParams using the supplied OID - if (EC_DecodeParams(¶ms_item, &ecparams, 0) != SECSuccess) { - /* bad curve OID */ -@@ -346,9 +394,15 @@ - - cleanup: - { -- if (params_item.data) -+ if (params_item.data) { - env->ReleaseByteArrayElements(encodedParams, - (jbyte *) params_item.data, JNI_ABORT); -+#ifdef SYSTEM_NSS -+ if (SECOID_Shutdown() != SECSuccess) { -+ ThrowException(env, INTERNAL_ERROR); -+ } -+#endif -+ } - - if (pubKey.publicValue.data) - env->ReleaseByteArrayElements(publicKey, -@@ -397,6 +451,13 @@ - params_item.data = - (unsigned char *) env->GetByteArrayElements(encodedParams, 0); - -+#ifdef SYSTEM_NSS -+ if (SECOID_Init() != SECSuccess) { -+ ThrowException(env, INTERNAL_ERROR); -+ goto cleanup; -+ } -+#endif -+ - // Fill a new ECParams using the supplied OID - if (EC_DecodeParams(¶ms_item, &ecparams, 0) != SECSuccess) { - /* bad curve OID */ -@@ -435,9 +496,15 @@ - env->ReleaseByteArrayElements(publicKey, - (jbyte *) publicValue_item.data, JNI_ABORT); - -- if (params_item.data) -+ if (params_item.data) { - env->ReleaseByteArrayElements(encodedParams, - (jbyte *) params_item.data, JNI_ABORT); -+#ifdef SYSTEM_NSS -+ if (SECOID_Shutdown() != SECSuccess) { -+ ThrowException(env, INTERNAL_ERROR); -+ } -+#endif -+ } - - if (ecparams) - FreeECParams(ecparams, true); - diff --git a/icedtea7-bug-2135.patch b/icedtea7-bug-2135.patch deleted file mode 100644 index f5940cf..0000000 --- a/icedtea7-bug-2135.patch +++ /dev/null @@ -1,202 +0,0 @@ - -# HG changeset patch -# User andrew -# Date 1418148279 0 -# Node ID 610eb1b5fd0beb4c4cf8918f418eeddf9ff58121 -# Parent 9ed0bdd5de2a5ebfa5fedb9442ee630b8d63ef0e -PR2135: Race condition in SunEC provider with system NSS - -diff -r 9ed0bdd5de2a -r 610eb1b5fd0b make/sun/security/ec/Makefile ---- openjdk/jdk/make/sun/security/ec/Makefile Fri Dec 05 09:52:04 2014 +0000 -+++ openjdk/jdk/make/sun/security/ec/Makefile Tue Dec 09 18:04:39 2014 +0000 -@@ -158,7 +158,8 @@ - FILES_export = \ - $(PKGDIR)/ECDHKeyAgreement.java \ - $(PKGDIR)/ECDSASignature.java \ -- $(PKGDIR)/ECKeyPairGenerator.java -+ $(PKGDIR)/ECKeyPairGenerator.java \ -+ $(PKGDIR)/SunEC.java - - JAVAHFLAGS = -bootclasspath \ - "$(CLASSDESTDIR)$(CLASSPATH_SEPARATOR)$(CLASSBINDIR)$(JCE_PATH)" -diff -r 9ed0bdd5de2a -r 610eb1b5fd0b make/sun/security/ec/mapfile-vers ---- openjdk/jdk/make/sun/security/ec/mapfile-vers Fri Dec 05 09:52:04 2014 +0000 -+++ openjdk/jdk/make/sun/security/ec/mapfile-vers Tue Dec 09 18:04:39 2014 +0000 -@@ -31,6 +31,8 @@ - Java_sun_security_ec_ECDSASignature_signDigest; - Java_sun_security_ec_ECDSASignature_verifySignedDigest; - Java_sun_security_ec_ECDHKeyAgreement_deriveKey; -+ Java_sun_security_ec_SunEC_initialize; -+ Java_sun_security_ec_SunEC_cleanup; - local: - *; - }; -diff -r 9ed0bdd5de2a -r 610eb1b5fd0b src/share/classes/sun/security/ec/SunEC.java ---- openjdk/jdk/src/share/classes/sun/security/ec/SunEC.java Fri Dec 05 09:52:04 2014 +0000 -+++ openjdk/jdk/src/share/classes/sun/security/ec/SunEC.java Tue Dec 09 18:04:39 2014 +0000 -@@ -58,6 +58,7 @@ - AccessController.doPrivileged(new PrivilegedAction() { - public Void run() { - System.loadLibrary("sunec"); // check for native library -+ initialize(); - return null; - } - }); -@@ -81,4 +82,22 @@ - } - } - -+ /** -+ * Cleanup native resources during finalisation. -+ */ -+ @Override -+ protected void finalize() { -+ cleanup(); -+ } -+ -+ /** -+ * Initialize the native code. -+ */ -+ private static native void initialize(); -+ -+ /** -+ * Cleanup in the native layer. -+ */ -+ private static native void cleanup(); -+ - } -diff -r 9ed0bdd5de2a -r 610eb1b5fd0b src/share/native/sun/security/ec/ECC_JNI.cpp ---- openjdk/jdk/src/share/native/sun/security/ec/ECC_JNI.cpp Fri Dec 05 09:52:04 2014 +0000 -+++ openjdk/jdk/src/share/native/sun/security/ec/ECC_JNI.cpp Tue Dec 09 18:04:39 2014 +0000 -@@ -116,13 +116,6 @@ - params_item.data = - (unsigned char *) env->GetByteArrayElements(encodedParams, 0); - --#ifdef SYSTEM_NSS -- if (SECOID_Init() != SECSuccess) { -- ThrowException(env, INTERNAL_ERROR); -- goto cleanup; -- } --#endif -- - // Fill a new ECParams using the supplied OID - if (EC_DecodeParams(¶ms_item, &ecparams, 0) != SECSuccess) { - /* bad curve OID */ -@@ -178,11 +171,6 @@ - if (params_item.data) { - env->ReleaseByteArrayElements(encodedParams, - (jbyte *) params_item.data, JNI_ABORT); --#ifdef SYSTEM_NSS -- if (SECOID_Shutdown() != SECSuccess) { -- ThrowException(env, INTERNAL_ERROR); -- } --#endif - } - - if (ecparams) { -@@ -246,13 +234,6 @@ - params_item.data = - (unsigned char *) env->GetByteArrayElements(encodedParams, 0); - --#ifdef SYSTEM_NSS -- if (SECOID_Init() != SECSuccess) { -- ThrowException(env, INTERNAL_ERROR); -- goto cleanup; -- } --#endif -- - // Fill a new ECParams using the supplied OID - if (EC_DecodeParams(¶ms_item, &ecparams, 0) != SECSuccess) { - /* bad curve OID */ -@@ -294,11 +275,6 @@ - if (params_item.data) { - env->ReleaseByteArrayElements(encodedParams, - (jbyte *) params_item.data, JNI_ABORT); --#ifdef SYSTEM_NSS -- if (SECOID_Shutdown() != SECSuccess) { -- ThrowException(env, INTERNAL_ERROR); -- } --#endif - } - - if (privKey.privateValue.data) { -@@ -367,13 +343,6 @@ - params_item.data = - (unsigned char *) env->GetByteArrayElements(encodedParams, 0); - --#ifdef SYSTEM_NSS -- if (SECOID_Init() != SECSuccess) { -- ThrowException(env, INTERNAL_ERROR); -- goto cleanup; -- } --#endif -- - // Fill a new ECParams using the supplied OID - if (EC_DecodeParams(¶ms_item, &ecparams, 0) != SECSuccess) { - /* bad curve OID */ -@@ -397,11 +366,6 @@ - if (params_item.data) { - env->ReleaseByteArrayElements(encodedParams, - (jbyte *) params_item.data, JNI_ABORT); --#ifdef SYSTEM_NSS -- if (SECOID_Shutdown() != SECSuccess) { -- ThrowException(env, INTERNAL_ERROR); -- } --#endif - } - - if (pubKey.publicValue.data) -@@ -451,13 +415,6 @@ - params_item.data = - (unsigned char *) env->GetByteArrayElements(encodedParams, 0); - --#ifdef SYSTEM_NSS -- if (SECOID_Init() != SECSuccess) { -- ThrowException(env, INTERNAL_ERROR); -- goto cleanup; -- } --#endif -- - // Fill a new ECParams using the supplied OID - if (EC_DecodeParams(¶ms_item, &ecparams, 0) != SECSuccess) { - /* bad curve OID */ -@@ -499,11 +456,6 @@ - if (params_item.data) { - env->ReleaseByteArrayElements(encodedParams, - (jbyte *) params_item.data, JNI_ABORT); --#ifdef SYSTEM_NSS -- if (SECOID_Shutdown() != SECSuccess) { -- ThrowException(env, INTERNAL_ERROR); -- } --#endif - } - - if (ecparams) -@@ -513,4 +465,26 @@ - return jSecret; - } - -+JNIEXPORT void -+JNICALL Java_sun_security_ec_SunEC_initialize -+ (JNIEnv *env, jclass UNUSED(clazz)) -+{ -+#ifdef SYSTEM_NSS -+ if (SECOID_Init() != SECSuccess) { -+ ThrowException(env, INTERNAL_ERROR); -+ } -+#endif -+} -+ -+JNIEXPORT void -+JNICALL Java_sun_security_ec_SunEC_cleanup -+ (JNIEnv *env, jclass UNUSED(clazz)) -+{ -+#ifdef SYSTEM_NSS -+ if (SECOID_Shutdown() != SECSuccess) { -+ ThrowException(env, INTERNAL_ERROR); -+ } -+#endif -+} -+ - } /* extern "C" */ - diff --git a/icedtea7.spec b/icedtea7.spec index 8063a7e..db1040c 100644 --- a/icedtea7.spec +++ b/icedtea7.spec @@ -31,36 +31,34 @@ Summary: OpenJDK and GNU Classpath code Summary(pl.UTF-8): Kod OpenJDK i GNU Classpath Name: icedtea7 -Version: 2.5.3 -Release: 9 +Version: 2.5.4 +Release: 0.1 License: GPL v2 Group: Development/Languages/Java Source0: http://icedtea.wildebeest.org/download/source/icedtea-%{version}.tar.gz -# Source0-md5: dfd8f5f356a5fc05e63bb38e7c4c030a +# Source0-md5: 646064d7a8d57c2cae0ef35a05de57c8 Source1: http://icedtea.wildebeest.org/download/drops/icedtea7/%{version}/openjdk.tar.bz2 -# Source1-md5: 730679eec8f645c05c0c518ae73a6f6d +# Source1-md5: 90c83c73214a083b24adfee9a1be56a4 Source2: http://icedtea.wildebeest.org/download/drops/icedtea7/%{version}/corba.tar.bz2 -# Source2-md5: b7dbab5f1ca314d613a9e7cf0a5939e1 +# Source2-md5: 06235b1e4b024402d6ec5cf0672cc353 Source3: http://icedtea.wildebeest.org/download/drops/icedtea7/%{version}/jaxp.tar.bz2 -# Source3-md5: 40e6d2e0e6b35a671bf1b0908c63ef9d +# Source3-md5: d3ffad8f8b415f002fd0f308279accbc Source4: http://icedtea.wildebeest.org/download/drops/icedtea7/%{version}/jaxws.tar.bz2 -# Source4-md5: 1615b1c82ac6a189d6805eedb8692402 +# Source4-md5: 03bb3aa6f03765816adf3d312feed05e Source5: http://icedtea.wildebeest.org/download/drops/icedtea7/%{version}/jdk.tar.bz2 -# Source5-md5: 7cc129b8ff8f195583cf40620588e013 +# Source5-md5: 4e848b426d98b60523f71e9f35edfff8 Source6: http://icedtea.wildebeest.org/download/drops/icedtea7/%{version}/langtools.tar.bz2 -# Source6-md5: fd28b781a95a609cd966c7048486e4ca +# Source6-md5: ffc690fecd801662d4b4f8874aecbc68 Source7: http://icedtea.wildebeest.org/download/drops/icedtea7/%{version}/hotspot.tar.bz2 -# Source7-md5: e58128728b81b99bf94d9cac39015975 +# Source7-md5: c3bbd2ff7bf67eae93f9c55ad3ff3b91 Source10: make-cacerts.sh # 0-99 patches for the IcedTea files Patch0: %{name}-x32-ac.patch # 100-... patches applied to the extracted sources Patch100: %{name}-libpath.patch Patch101: %{name}-giflib.patch -Patch102: icedtea7-bug-2123.patch -Patch103: icedtea7-bug-2135.patch -Patch104: %{name}-x32.patch -Patch105: currency-change-fix.patch +Patch102: %{name}-x32.patch +Patch103: currency-change-fix.patch URL: http://icedtea.classpath.org/wiki/Main_Page BuildRequires: alsa-lib-devel BuildRequires: ant @@ -422,12 +420,10 @@ Przykłady dla OpenJDK. install -d pld-patches cp -p %{PATCH100} pld-patches cp -p %{PATCH101} pld-patches -cp -p %{PATCH102} pld-patches -cp -p %{PATCH103} pld-patches %ifarch x32 -cp -p %{PATCH104} pld-patches +cp -p %{PATCH102} pld-patches %endif -cp -p %{PATCH105} pld-patches +cp -p %{PATCH103} pld-patches # let the build system extract the sources where it wants them install -d drops -- 2.44.0