diff --git a/0001-added-back-support-for-subject-key-identifier-check-.patch b/0001-added-back-support-for-subject-key-identifier-check-.patch deleted file mode 100644 index a2e2481f493a0a84298129998a7b01f838ea3b63..0000000000000000000000000000000000000000 --- a/0001-added-back-support-for-subject-key-identifier-check-.patch +++ /dev/null @@ -1,32 +0,0 @@ -From d1fb007090813ce348a2d439f12fa347a8d5010c Mon Sep 17 00:00:00 2001 -From: David Hook -Date: Wed, 12 Jan 2022 15:02:59 +1100 -Subject: [PATCH] added back support for subject key identifier check where - serial number is not provided. - ---- - .../java/org/bouncycastle/x509/PKIXCertPathReviewer.java | 8 ++++++++ - 1 file changed, 8 insertions(+) - -diff --git a/prov/src/main/java/org/bouncycastle/x509/PKIXCertPathReviewer.java b/prov/src/main/java/org/bouncycastle/x509/PKIXCertPathReviewer.java -index 58a07d6c7..a78e97735 100644 ---- a/prov/src/main/java/org/bouncycastle/x509/PKIXCertPathReviewer.java -+++ b/prov/src/main/java/org/bouncycastle/x509/PKIXCertPathReviewer.java -@@ -2492,6 +2492,14 @@ protected Collection getTrustAnchors(X509Certificate cert, Set trustanchors) thr - { - certSelectX509.setSerialNumber(authID.getAuthorityCertSerialNumber()); - } -+ else -+ { -+ byte[] keyID = authID.getKeyIdentifier(); -+ if (keyID != null) -+ { -+ certSelectX509.setSubjectKeyIdentifier(new DEROctetString(keyID).getEncoded()); -+ } -+ } - } - } - catch (IOException ex) --- -2.34.1 - diff --git a/1001-jmail_packages.patch b/1001-jmail_packages.patch new file mode 100644 index 0000000000000000000000000000000000000000..81eaf06224aa39300092a9aadf50d357a12d5567 --- /dev/null +++ b/1001-jmail_packages.patch @@ -0,0 +1,32 @@ +From 967daf9dcebc0c72c0a516c2e0451aaa08fc8823 Mon Sep 17 00:00:00 2001 +From: sa-buc +Date: Thu, 5 Jun 2025 17:07:29 +0800 +Subject: [PATCH 1/1] modify the README.md + +--- + ant/bc+-build.xml | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/ant/bc+-build.xml b/ant/bc+-build.xml +index 567c2a5..54be67b 100644 +--- a/ant/bc+-build.xml ++++ b/ant/bc+-build.xml +@@ -652,13 +652,13 @@ + + + +- ++ + + + + + +- ++ + + + +-- +2.43.5 + diff --git a/bcjmail-jdk18on-1.77.pom b/bcjmail-jdk18on-1.77.pom new file mode 100644 index 0000000000000000000000000000000000000000..7741c25fcc45bbdf1e90f34a61a8c800ec72f10c --- /dev/null +++ b/bcjmail-jdk18on-1.77.pom @@ -0,0 +1,52 @@ + + + 4.0.0 + org.bouncycastle + bcjmail-jdk18on + jar + Bouncy Castle Jakarta S/MIME API + 1.77 + The Bouncy Castle Java S/MIME APIs for handling S/MIME protocols. This jar contains S/MIME APIs for JDK 1.8 and up. The APIs can be used in conjunction with a JCE/JCA provider such as the one provided with the Bouncy Castle Cryptography APIs. The Jakarta Mail API and the Jakarta activation framework will also be needed. + https://www.bouncycastle.org/java.html + + + Bouncy Castle Licence + https://www.bouncycastle.org/licence.html + repo + + + + https://github.com/bcgit/bc-java + + + GitHub + https://github.com/bcgit/bc-java/issues + + + + feedback-crypto + The Legion of the Bouncy Castle Inc. + feedback-crypto@bouncycastle.org + + + + + org.bouncycastle + bcprov-jdk18on + 1.77 + jar + + + org.bouncycastle + bcutil-jdk18on + 1.77 + jar + + + org.bouncycastle + bcpkix-jdk18on + 1.77 + jar + + + diff --git a/bcmail-jdk15on-1.70.pom b/bcmail-jdk18on-1.77.pom similarity index 80% rename from bcmail-jdk15on-1.70.pom rename to bcmail-jdk18on-1.77.pom index 140e13f5fa6b4196550127fe57b61a0e28885ae6..19ab6727df7b677944d461e40a7d977145f9f7cf 100644 --- a/bcmail-jdk15on-1.70.pom +++ b/bcmail-jdk18on-1.77.pom @@ -2,11 +2,11 @@ 4.0.0 org.bouncycastle - bcmail-jdk15on + bcmail-jdk18on jar Bouncy Castle S/MIME API - 1.70 - The Bouncy Castle Java S/MIME APIs for handling S/MIME protocols. This jar contains S/MIME APIs for JDK 1.5 and up. The APIs can be used in conjunction with a JCE/JCA provider such as the one provided with the Bouncy Castle Cryptography APIs. The JavaMail API and the Java activation framework will also be needed. + 1.77 + The Bouncy Castle Java S/MIME APIs for handling S/MIME protocols. This jar contains S/MIME APIs for JDK 1.8 and up. The APIs can be used in conjunction with a JCE/JCA provider such as the one provided with the Bouncy Castle Cryptography APIs. The JavaMail API and the Java activation framework will also be needed. https://www.bouncycastle.org/java.html @@ -32,20 +32,20 @@ org.bouncycastle - bcprov-jdk15on - 1.70 + bcprov-jdk18on + 1.77 jar org.bouncycastle - bcutil-jdk15on - 1.70 + bcutil-jdk18on + 1.77 jar org.bouncycastle - bcpkix-jdk15on - 1.70 + bcpkix-jdk18on + 1.77 jar diff --git a/bcpg-jdk15on-1.70.pom b/bcpg-jdk18on-1.77.pom similarity index 79% rename from bcpg-jdk15on-1.70.pom rename to bcpg-jdk18on-1.77.pom index e16fdc21460fed278e29679f3e8db202c1259d44..9a008781fba677035758497a56a29bdc61e970eb 100644 --- a/bcpg-jdk15on-1.70.pom +++ b/bcpg-jdk18on-1.77.pom @@ -2,11 +2,11 @@ 4.0.0 org.bouncycastle - bcpg-jdk15on + bcpg-jdk18on jar Bouncy Castle OpenPGP API - 1.70 - The Bouncy Castle Java API for handling the OpenPGP protocol. This jar contains the OpenPGP API for JDK 1.5 and up. The APIs can be used in conjunction with a JCE/JCA provider such as the one provided with the Bouncy Castle Cryptography APIs. + 1.77 + The Bouncy Castle Java API for handling the OpenPGP protocol. This jar contains the OpenPGP API for JDK 1.8 and up. The APIs can be used in conjunction with a JCE/JCA provider such as the one provided with the Bouncy Castle Cryptography APIs. https://www.bouncycastle.org/java.html @@ -15,8 +15,8 @@ repo - Apache Software License, Version 1.1 - https://www.apache.org/licenses/LICENSE-1.1 + Apache Software License, Version 2.0 + https://www.apache.org/licenses/LICENSE-2.0 repo @@ -37,8 +37,8 @@ org.bouncycastle - bcprov-jdk15on - 1.70 + bcprov-jdk18on + 1.77 jar diff --git a/bcpkix-jdk15on-1.70.pom b/bcpkix-jdk18on-1.77.pom similarity index 82% rename from bcpkix-jdk15on-1.70.pom rename to bcpkix-jdk18on-1.77.pom index 01353ff1466a7f78acc97aa68bc08806d5711202..4819e5b429453cee58eac1a6c55f257023a576d2 100644 --- a/bcpkix-jdk15on-1.70.pom +++ b/bcpkix-jdk18on-1.77.pom @@ -2,11 +2,11 @@ 4.0.0 org.bouncycastle - bcpkix-jdk15on + bcpkix-jdk18on jar Bouncy Castle PKIX, CMS, EAC, TSP, PKCS, OCSP, CMP, and CRMF APIs - 1.70 - The Bouncy Castle Java APIs for CMS, PKCS, EAC, TSP, CMP, CRMF, OCSP, and certificate generation. This jar contains APIs for JDK 1.5 and up. The APIs can be used in conjunction with a JCE/JCA provider such as the one provided with the Bouncy Castle Cryptography APIs. + 1.77 + The Bouncy Castle Java APIs for CMS, PKCS, EAC, TSP, CMP, CRMF, OCSP, and certificate generation. This jar contains APIs for JDK 1.8 and up. The APIs can be used in conjunction with a JCE/JCA provider such as the one provided with the Bouncy Castle Cryptography APIs. https://www.bouncycastle.org/java.html @@ -32,14 +32,14 @@ org.bouncycastle - bcprov-jdk15on - 1.70 + bcprov-jdk18on + 1.77 jar org.bouncycastle - bcutil-jdk15on - 1.70 + bcutil-jdk18on + 1.77 jar diff --git a/bcprov-jdk15on-1.70.pom b/bcprov-jdk18on-1.77.pom similarity index 90% rename from bcprov-jdk15on-1.70.pom rename to bcprov-jdk18on-1.77.pom index ea5148262ce83bcf4e3ce7d0597138bcba0872c4..4dbd87a3d7ff7dc5c836b06aebb0cd040af64d50 100644 --- a/bcprov-jdk15on-1.70.pom +++ b/bcprov-jdk18on-1.77.pom @@ -2,11 +2,11 @@ 4.0.0 org.bouncycastle - bcprov-jdk15on + bcprov-jdk18on jar Bouncy Castle Provider - 1.70 - The Bouncy Castle Crypto package is a Java implementation of cryptographic algorithms. This jar contains JCE provider and lightweight API for the Bouncy Castle Cryptography APIs for JDK 1.5 and up. + 1.77 + The Bouncy Castle Crypto package is a Java implementation of cryptographic algorithms. This jar contains JCE provider and lightweight API for the Bouncy Castle Cryptography APIs for JDK 1.8 and up. https://www.bouncycastle.org/java.html diff --git a/bctls-jdk15on-1.70.pom b/bctls-jdk18on-1.77.pom similarity index 84% rename from bctls-jdk15on-1.70.pom rename to bctls-jdk18on-1.77.pom index 7612c05afcb194e96208cd85f937347b04ddab52..4f13967260d206c2a29a0122ae0b6412ecc1b08d 100644 --- a/bctls-jdk15on-1.70.pom +++ b/bctls-jdk18on-1.77.pom @@ -2,10 +2,10 @@ 4.0.0 org.bouncycastle - bctls-jdk15on + bctls-jdk18on jar Bouncy Castle JSSE provider and TLS/DTLS API - 1.70 + 1.77 The Bouncy Castle Java APIs for TLS and DTLS, including a provider for the JSSE. https://www.bouncycastle.org/java.html @@ -32,14 +32,14 @@ org.bouncycastle - bcprov-jdk15on - 1.70 + bcprov-jdk18on + 1.77 jar org.bouncycastle - bcutil-jdk15on - 1.70 + bcutil-jdk18on + 1.77 jar diff --git a/bcutil-jdk15on-1.70.pom b/bcutil-jdk18on-1.77.pom similarity index 85% rename from bcutil-jdk15on-1.70.pom rename to bcutil-jdk18on-1.77.pom index 994c9354051d04169cb47e7f1b9472a21f1d0c9b..abde4abb1a9cddc47b595333bd1ba939eaf06f0c 100644 --- a/bcutil-jdk15on-1.70.pom +++ b/bcutil-jdk18on-1.77.pom @@ -2,11 +2,11 @@ 4.0.0 org.bouncycastle - bcutil-jdk15on + bcutil-jdk18on jar Bouncy Castle ASN.1 Extension and Utility APIs - 1.70 - The Bouncy Castle Java APIs for ASN.1 extension and utility APIs used to support bcpkix and bctls. This jar contains APIs for JDK 1.5 and up. + 1.77 + The Bouncy Castle Java APIs for ASN.1 extension and utility APIs used to support bcpkix and bctls. This jar contains APIs for JDK 1.8 and up. https://www.bouncycastle.org/java.html @@ -32,8 +32,8 @@ org.bouncycastle - bcprov-jdk15on - 1.70 + bcprov-jdk18on + 1.77 jar diff --git a/bouncycastle.spec b/bouncycastle.spec index 1361381f95864a3a10a6f5c602e3561cc6a7ae8e..d251fdda998e25cd663e574da01f47954d356f25 100644 --- a/bouncycastle.spec +++ b/bouncycastle.spec @@ -1,31 +1,35 @@ -%define anolis_release 2 - -%global gittag r1rv70 +%define anolis_release 1 + +%global gittag r1rv77 %global classname org.bouncycastle.jce.provider.BouncyCastleProvider - +%global profilen 1.8 +%global profile %(echo %{profilen} | sed "s/\\.//g" ) +%global jdkon jdk%{profile}on + Summary: Bouncy Castle Cryptography APIs for Java Name: bouncycastle -Version: 1.70 +Version: 1.77 Release: %{anolis_release}%{?dist} License: MIT URL: http://www.bouncycastle.org - + Source0: https://github.com/bcgit/bc-java/archive/%{gittag}.tar.gz - + # POMs from Maven Central -Source1: https://repo1.maven.org/maven2/org/bouncycastle/bcprov-jdk15on/%{version}/bcprov-jdk15on-%{version}.pom -Source2: https://repo1.maven.org/maven2/org/bouncycastle/bcpkix-jdk15on/%{version}/bcpkix-jdk15on-%{version}.pom -Source3: https://repo1.maven.org/maven2/org/bouncycastle/bcpg-jdk15on/%{version}/bcpg-jdk15on-%{version}.pom -Source4: https://repo1.maven.org/maven2/org/bouncycastle/bcmail-jdk15on/%{version}/bcmail-jdk15on-%{version}.pom -Source5: https://repo1.maven.org/maven2/org/bouncycastle/bctls-jdk15on/%{version}/bctls-jdk15on-%{version}.pom -Source6: https://repo1.maven.org/maven2/org/bouncycastle/bcutil-jdk15on/%{version}/bcutil-jdk15on-%{version}.pom - +Source1: https://repo1.maven.org/maven2/org/bouncycastle/bcprov-%{jdkon}/%{version}/bcprov-%{jdkon}-%{version}.pom +Source2: https://repo1.maven.org/maven2/org/bouncycastle/bcpkix-%{jdkon}/%{version}/bcpkix-%{jdkon}-%{version}.pom +Source3: https://repo1.maven.org/maven2/org/bouncycastle/bcpg-%{jdkon}/%{version}/bcpg-%{jdkon}-%{version}.pom +Source4: https://repo1.maven.org/maven2/org/bouncycastle/bcmail-%{jdkon}/%{version}/bcmail-%{jdkon}-%{version}.pom +Source5: https://repo1.maven.org/maven2/org/bouncycastle/bctls-%{jdkon}/%{version}/bctls-%{jdkon}-%{version}.pom +Source6: https://repo1.maven.org/maven2/org/bouncycastle/bcutil-%{jdkon}/%{version}/bcutil-%{jdkon}-%{version}.pom +Source7: https://repo1.maven.org/maven2/org/bouncycastle/bcjmail-%{jdkon}/%{version}/bcjmail-%{jdkon}-%{version}.pom + # Script to fetch POMs from Maven Central -Source7: get-poms.sh - -# Backport fix for regression in bouncycastle 1.70 -Patch0: 0001-added-back-support-for-subject-key-identifier-check-.patch +Source8: get-poms.sh +# From https://src.fedoraproject.org/rpms/bouncycastle/blob/d0ad563d8f8f61b9631e5562028b30b407d97094/f/jmail.packages.patch +Patch0: 1001-jmail_packages.patch + BuildArch: noarch ExclusiveArch: %{java_arches} noarch @@ -35,132 +39,147 @@ BuildRequires: aqute-bnd BuildRequires: ant BuildRequires: ant-junit BuildRequires: javapackages-local - +BuildRequires: jakarta-activation1 +BuildRequires: jakarta-mail1 + Requires(post): javapackages-tools Requires(postun): javapackages-tools - + Provides: bcprov = %{version}-%{release} - + %description The Bouncy Castle Crypto package is a Java implementation of cryptographic algorithms. This jar contains JCE provider and lightweight API for the Bouncy Castle Cryptography APIs for JDK 1.5 to JDK 1.8. - + %package pkix Summary: Bouncy Castle PKIX, CMS, EAC, TSP, PKCS, OCSP, CMP, and CRMF APIs - + %description pkix The Bouncy Castle Java APIs for CMS, PKCS, EAC, TSP, CMP, CRMF, OCSP, and certificate generation. This jar contains APIs for JDK 1.5 to JDK 1.8. The APIs can be used in conjunction with a JCE/JCA provider such as the one provided with the Bouncy Castle Cryptography APIs. - + %package pg Summary: Bouncy Castle OpenPGP API - + %description pg The Bouncy Castle Java API for handling the OpenPGP protocol. The APIs can be used in conjunction with a JCE/JCA provider such as the one provided with the Bouncy Castle Cryptography APIs. - + %package mail Summary: Bouncy Castle S/MIME API - + %description mail The Bouncy Castle Java S/MIME APIs for handling S/MIME protocols. The APIs can be used in conjunction with a JCE/JCA provider such as the one provided with the Bouncy Castle Cryptography APIs. The JavaMail API and the Java activation framework will also be needed. - + +%package jmail +Summary: Bouncy Castle Jakarta S/MIME API + +%description jmail +The Bouncy Castle Java S/MIME APIs for handling S/MIME protocols. The APIs can +be used in conjunction with a JCE/JCA provider such as the one provided with +the Bouncy Castle Cryptography APIs. The Jakarta Mail API and the Jakarta +activation framework will also be needed. + %package tls Summary: Bouncy Castle JSSE provider and TLS/DTLS API - + %description tls The Bouncy Castle Java APIs for TLS and DTLS, including a provider for the JSSE. - + %package util Summary: Bouncy Castle ASN.1 Extension and Utility APIs - + %description util The Bouncy Castle Java APIs for ASN.1 extension and utility APIs used to support bcpkix and bctls. - + %package javadoc Summary: Javadoc for %{name} - + %description javadoc API documentation for the Bouncy Castle Cryptography APIs. - + %prep -%setup -q -n bc-java-%{gittag} -%patch0 -p1 - +%setup -q -n bc-java-%{gittag} +%patch -P0 -p1 + +for x in `find | grep -e x_pkcs7_signature.java -e PKCS7ContentHandler.java -e multipart_signed.java` ; do + sed "s/getTransferData.ActivationDataFlavor/getTransferData(DataFlavor/g" -i $x + sed "s/ ActivationDataFlavor df,/ DataFlavor df,/g" -i $x +done + # Remove bundled binary libs find . -type f -name "*.class" -exec rm -f {} \; find . -type f -name "*.jar" -exec rm -f {} \; - -# Relax javadoc linting and set expected source encoding -sed -i -e '/ bnd.bnd < - 1.77-1 +- Update to 1.77 + * Wed Dec 27 2023 mgb01105731 - 1.70-2 - rebuild diff --git a/download b/download index 0755c20b8499d7f4ad83977ddb70147942448783..8abf25a2decf9d887d9748b2f08d25d05cbee5e0 100644 --- a/download +++ b/download @@ -1 +1 @@ -dfb9fe299291ebad193e37cbc8d0eef9 r1rv70.tar.gz +86d470bf1965cc585767a4d2984cfa4e r1rv77.tar.gz