diff --git a/0001-added-back-support-for-subject-key-identifier-check-.patch b/0001-added-back-support-for-subject-key-identifier-check-.patch new file mode 100644 index 0000000000000000000000000000000000000000..a2e2481f493a0a84298129998a7b01f838ea3b63 --- /dev/null +++ b/0001-added-back-support-for-subject-key-identifier-check-.patch @@ -0,0 +1,32 @@ +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/README.en.md b/README.en.md index 38a90f3007e9569b3562e332435a006673a4e3ff..30c76596a0dfb0c770554fa769915a5a34761e83 100644 --- a/README.en.md +++ b/README.en.md @@ -1,7 +1,7 @@ # bouncycastle #### Description -{**When you're done, you can delete the content in this README and update the file with details for others getting started with your repository**} +bouncycastle #### Software Architecture Software architecture description diff --git a/README.md b/README.md index 6db769d5b261036dbc978b3646dc41d8aaf108a6..a9dea6acff87c4449f974967a3d4534383c096d3 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,7 @@ # bouncycastle #### 介绍 -{**以下是 Gitee 平台说明,您可以替换此简介** -Gitee 是 OSCHINA 推出的基于 Git 的代码托管平台(同时支持 SVN)。专为开发者提供稳定、高效、安全的云端软件开发协作平台 -无论是个人、团队、或是企业,都能够用 Gitee 实现代码托管、项目管理、协作开发。企业项目请看 [https://gitee.com/enterprises](https://gitee.com/enterprises)} +bouncycastle #### 软件架构 软件架构说明 diff --git a/bcmail-jdk15on-1.70.pom b/bcmail-jdk15on-1.70.pom new file mode 100644 index 0000000000000000000000000000000000000000..140e13f5fa6b4196550127fe57b61a0e28885ae6 --- /dev/null +++ b/bcmail-jdk15on-1.70.pom @@ -0,0 +1,52 @@ + + + 4.0.0 + org.bouncycastle + bcmail-jdk15on + 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. + 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-jdk15on + 1.70 + jar + + + org.bouncycastle + bcutil-jdk15on + 1.70 + jar + + + org.bouncycastle + bcpkix-jdk15on + 1.70 + jar + + + diff --git a/bcpg-jdk15on-1.70.pom b/bcpg-jdk15on-1.70.pom new file mode 100644 index 0000000000000000000000000000000000000000..e16fdc21460fed278e29679f3e8db202c1259d44 --- /dev/null +++ b/bcpg-jdk15on-1.70.pom @@ -0,0 +1,45 @@ + + + 4.0.0 + org.bouncycastle + bcpg-jdk15on + 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. + https://www.bouncycastle.org/java.html + + + Bouncy Castle Licence + https://www.bouncycastle.org/licence.html + repo + + + Apache Software License, Version 1.1 + https://www.apache.org/licenses/LICENSE-1.1 + 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-jdk15on + 1.70 + jar + + + diff --git a/bcpkix-jdk15on-1.70.pom b/bcpkix-jdk15on-1.70.pom new file mode 100644 index 0000000000000000000000000000000000000000..01353ff1466a7f78acc97aa68bc08806d5711202 --- /dev/null +++ b/bcpkix-jdk15on-1.70.pom @@ -0,0 +1,46 @@ + + + 4.0.0 + org.bouncycastle + bcpkix-jdk15on + 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. + 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-jdk15on + 1.70 + jar + + + org.bouncycastle + bcutil-jdk15on + 1.70 + jar + + + diff --git a/bcprov-jdk15on-1.70.pom b/bcprov-jdk15on-1.70.pom new file mode 100644 index 0000000000000000000000000000000000000000..ea5148262ce83bcf4e3ce7d0597138bcba0872c4 --- /dev/null +++ b/bcprov-jdk15on-1.70.pom @@ -0,0 +1,32 @@ + + + 4.0.0 + org.bouncycastle + bcprov-jdk15on + 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. + 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 + + + diff --git a/bctls-jdk15on-1.70.pom b/bctls-jdk15on-1.70.pom new file mode 100644 index 0000000000000000000000000000000000000000..7612c05afcb194e96208cd85f937347b04ddab52 --- /dev/null +++ b/bctls-jdk15on-1.70.pom @@ -0,0 +1,46 @@ + + + 4.0.0 + org.bouncycastle + bctls-jdk15on + jar + Bouncy Castle JSSE provider and TLS/DTLS API + 1.70 + The Bouncy Castle Java APIs for TLS and DTLS, including a provider for the JSSE. + 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-jdk15on + 1.70 + jar + + + org.bouncycastle + bcutil-jdk15on + 1.70 + jar + + + diff --git a/bcutil-jdk15on-1.70.pom b/bcutil-jdk15on-1.70.pom new file mode 100644 index 0000000000000000000000000000000000000000..994c9354051d04169cb47e7f1b9472a21f1d0c9b --- /dev/null +++ b/bcutil-jdk15on-1.70.pom @@ -0,0 +1,40 @@ + + + 4.0.0 + org.bouncycastle + bcutil-jdk15on + 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. + 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-jdk15on + 1.70 + jar + + + diff --git a/bouncycastle.spec b/bouncycastle.spec new file mode 100644 index 0000000000000000000000000000000000000000..242a77a1e0cde73d03d987a2d3b3e3bb522dbcd0 --- /dev/null +++ b/bouncycastle.spec @@ -0,0 +1,224 @@ +%define anolis_release 1 + +%global gittag r1rv70 +%global classname org.bouncycastle.jce.provider.BouncyCastleProvider + +Summary: Bouncy Castle Cryptography APIs for Java +Name: bouncycastle +Version: 1.70 +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 + +# 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 + +BuildArch: noarch +ExclusiveArch: %{java_arches} noarch + +BuildRequires: jakarta-activation +BuildRequires: jakarta-mail +BuildRequires: aqute-bnd +BuildRequires: ant +BuildRequires: ant-junit +BuildRequires: javapackages-local + +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 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 + +# 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 <> "$secfile" + done + done +} || : + +%postun +if [ "$1" -eq 0 ] ; then + + { + # Rebuild the list of security providers in classpath.security + suffix=security/classpath.security + secfiles="/usr/lib/$suffix /usr/lib64/$suffix" + + for secfile in $secfiles + do + # check if this classpath.security file exists + [ -f "$secfile" ] || continue + + sed -i '/^security\.provider\./d' "$secfile" + + count=0 + for provider in $(ls /etc/java/security/security.d) + do + count=$((count + 1)) + echo "security.provider.${count}=${provider#*-}" >> "$secfile" + done + done + } || : + +fi + +%files -f .mfiles-bcprov +%license build/artifacts/jdk1.5/bcprov-jdk15on-*/LICENSE.html +%doc docs/ *.html +%{_sysconfdir}/java/security/security.d/2000-%{classname} + +%files pkix -f .mfiles-bcpkix +%license build/artifacts/jdk1.5/bcpkix-jdk15on-*/LICENSE.html + +%files pg -f .mfiles-bcpg +%license build/artifacts/jdk1.5/bcpg-jdk15on-*/LICENSE.html + +%files mail -f .mfiles-bcmail +%license build/artifacts/jdk1.5/bcmail-jdk15on-*/LICENSE.html + +%files tls -f .mfiles-bctls +%license build/artifacts/jdk1.5/bctls-jdk15on-*/LICENSE.html + +%files util -f .mfiles-bcutil +%license build/artifacts/jdk1.5/bcutil-jdk15on-*/LICENSE.html + +%files javadoc -f .mfiles-javadoc +%license LICENSE.html + +%changelog +* Mon Jun 19 2023 mgb01105731 - 1.70-1 +- Init upstream from version 1.70 diff --git a/download b/download new file mode 100644 index 0000000000000000000000000000000000000000..45f1fdf16cd0e50317ab7bc44f1252f8909d2c80 --- /dev/null +++ b/download @@ -0,0 +1 @@ +70facc9d4b3bdaafbc598352858a50c3 r1rv70.tar.gz diff --git a/get-poms.sh b/get-poms.sh new file mode 100755 index 0000000000000000000000000000000000000000..24e0ca6d37edafc33e324299ed570092bfbeae5e --- /dev/null +++ b/get-poms.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +version=$(grep '^Version:' bouncycastle.spec | sed -e 's/^Version:\W*//') + +for bc in bcprov bcpkix bcpg bcmail bctls bcutil ; do + rm -f $bc-*.pom + wget https://repo1.maven.org/maven2/org/bouncycastle/$bc-jdk15on/$version/$bc-jdk15on-$version.pom +done