diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml
index a4c720847e..3ec390f55e 100644
--- a/.github/workflows/codeql.yml
+++ b/.github/workflows/codeql.yml
@@ -67,8 +67,8 @@ jobs:
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
# - run: |
- echo "Run, Build Application using script"
- gradle clean build
+ # echo "Run, Build Application using script"
+ # gradle clean build
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
diff --git a/.gitignore b/.gitignore
index 72ab296f63..6c3cd331f6 100644
--- a/.gitignore
+++ b/.gitignore
@@ -8,6 +8,8 @@
*.swp
*.iml
*/*.iml
+*.ipr
+*.iws
bin/
build/
@@ -22,7 +24,7 @@ pg/*.bak
pg/*.bpg
pg/*.txt
-.idea
+.idea/
codesigning.jks
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 4f7b3f73fd..832bffa0fc 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -2,6 +2,8 @@ stages:
- check
- build
- test
+ - publish
+ - sync
check-code:
stage: check
@@ -30,33 +32,13 @@ ant-build:
- "ci_docker_run \"vm_base_intel:latest\" \"bc-java\" \"/workspace/bc-java/ci/build_1_8.sh\""
-test-code-8:
+test-code:
stage: test
needs: [ "check-code" ]
script:
- "ecr_login"
- "ecr_pull vm_base_intel latest"
- - "ci_docker_run \"vm_base_intel:latest\" \"bc-java\" \"/workspace/bc-java/ci/test_8.sh\""
- artifacts:
- when: always
- reports:
- junit:
- - "core/build/test-results/**/*.xml"
- - "prov/build/test-results/**/*.xml"
- - "pg/build/test-results/**/*.xml"
- - "pkix/build/test-results/**/*.xml"
- - "mail/build/test-results/**/*.xml"
- - "util/build/test-results/**/*.xml"
- - "tls/build/test-results/**/*.xml"
- - "mls/build/test-results/**/*.xml"
-
-test-code-11:
- stage: test
- needs: [ "check-code" ]
- script:
- - "ecr_login"
- - "ecr_pull vm_base_intel latest"
- - "ci_docker_run \"vm_base_intel:latest\" \"bc-java\" \"/workspace/bc-java/ci/test_11.sh\""
+ - "ci_docker_run \"vm_base_intel:latest\" \"bc-java\" \"/workspace/bc-java/ci/test.sh\""
artifacts:
when: always
reports:
@@ -71,43 +53,15 @@ test-code-11:
- "mls/build/test-results/**/*.xml"
-test-code-17:
- stage: test
- needs: [ "check-code" ]
+publish:
+ stage: publish
script:
+ - "apply_overlay bc-java-pub ./"
- "ecr_login"
- "ecr_pull vm_base_intel latest"
- - "ci_docker_run \"vm_base_intel:latest\" \"bc-java\" \"/workspace/bc-java/ci/test_17.sh\""
- artifacts:
- when: always
- reports:
- junit:
- - "core/build/test-results/**/*.xml"
- - "prov/build/test-results/**/*.xml"
- - "pg/build/test-results/**/*.xml"
- - "pkix/build/test-results/**/*.xml"
- - "mail/build/test-results/**/*.xml"
- - "util/build/test-results/**/*.xml"
- - "tls/build/test-results/**/*.xml"
- - "mls/build/test-results/**/*.xml"
-
+ - "ci_docker_run \"vm_base_intel:latest\" \"bc-java\" \"/workspace/bc-java/ci/pub.sh\""
-test-code-21:
- stage: test
- needs: [ "check-code" ]
+spongycastle:
+ stage: "sync"
script:
- - "ecr_login"
- - "ecr_pull vm_base_intel latest"
- - "ci_docker_run \"vm_base_intel:latest\" \"bc-java\" \"/workspace/bc-java/ci/test_21.sh\""
- artifacts:
- when: always
- reports:
- junit:
- - "core/build/test-results/**/*.xml"
- - "prov/build/test-results/**/*.xml"
- - "pg/build/test-results/**/*.xml"
- - "pkix/build/test-results/**/*.xml"
- - "mail/build/test-results/**/*.xml"
- - "util/build/test-results/**/*.xml"
- - "tls/build/test-results/**/*.xml"
- - "mls/build/test-results/**/*.xml"
+ - "syncpongy.sh"
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
new file mode 100644
index 0000000000..771bf2884b
--- /dev/null
+++ b/CONTRIBUTING.md
@@ -0,0 +1,51 @@
+# Bouncy Castle Contributing Guidelines
+
+Thank you for contributing to Bouncy Castle!
+
+In this guide, you get an overview of the contribution workflow from starting a discussion or opening an issue, to creating, reviewing, and merging a pull request.
+
+For an overview of the project, see [README](README.md).
+
+### Start a discussion
+If you have a question or problem, you can [search in discussions](https://github.com/bcgit/bc-java/discussions), if someone has already found a solution to your problem.
+
+Or you can [start a new discussion](https://github.com/bcgit/bc-java/discussions/new/choose) and ask your question.
+
+### Create an issue
+
+If you find a problem with Bouncy Castle, [search if an issue already exists](https://github.com/bcgit/bc-java/issues).
+
+> **_NOTE:_** If the issue is a __potential security problem__, please contact us
+before posting anything public. See [Security Policy](SECURITY.md).
+
+If a related discussion or issue doesn't exist, and the issue is not security related, you can [open a new issue](https://github.com/bcgit/bc-java/issues/new). An issue can be converted into a discussion if regarded as one.
+
+### Contribute to the code
+
+For substantial, non-trivial contributions, you may be asked to sign a contributor assignment agreement. Optionally, you can also have your name and contact information listed in [Contributors](https://www.bouncycastle.org/contributors.html).
+
+Please note we are unable to accept contributions which cannot be released under the [Bouncy Castle License](https://www.bouncycastle.org/licence.html). Issuing a pull request on our public github mirror is taken as agreement to issuing under the Bouncy Castle License.
+
+#### Create a pull request
+
+> **_NOTE:_** If the issue is a __potential security problem__, please contact us. See [Security Policy](SECURITY.md).
+
+You are welcome to send patches, under the Bouncy Castle License, as pull requests. For more information, see [Creating a pull request](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request). For minor updates, you can instead choose to create an issue with short snippets of code. See above.
+
+* For contributions touching multiple files try and split up the pull request, smaller changes are easier to review and test, as well as being less likely to run into merge issues.
+* Create a test cases for your change, it may be a simple addition to an existing test. If you do not know how to do this, ask us and we will help you.
+* If you run into any merge issues, check out this [git tutorial](https://github.com/skills/resolve-merge-conflicts) to help you resolve merge conflicts and other issues.
+
+For more information, refer to the Bouncy Castle documentation on [Getting Started with Bouncy Castle](https://doc.primekey.com/bouncycastle/introduction#Introduction-GettingStartedwithBouncyCastle).
+
+#### Self-review
+
+Don't forget to self-review. Please follow these simple guidelines:
+* Keep the patch limited, only change the parts related to your patch.
+* Do not change other lines, such as whitespace, adding line breaks to Java doc, etc. It will make it very hard for us to review the patch.
+
+
+#### Your pull request is merged
+
+For acceptance, pull requests need to meet specific quality criteria, including tests for anything substantial. Someone on the Bouncy Castle core team will review the pull request when there is time, and let you know if something is missing or suggest improvements. If it is a useful and generic feature it will be integrated in Bouncy Castle to be available in a later release.
+
diff --git a/CONTRIBUTORS.html b/CONTRIBUTORS.html
index 12e559629f..ba9ab62d06 100644
--- a/CONTRIBUTORS.html
+++ b/CONTRIBUTORS.html
@@ -447,16 +447,15 @@
Adam Vartanian <https://github.com/flooey> use of ShortBuffer exception and buffer size pre-check in Cipher.doFinal().
Bernd <https://github.com/ecki> Fix to make PGPUtil.pipeFileContents use buffer and not leak file handle.
Shartung <https://github.com/shartung> Additional EC Key Agreement algorithms in support of German BSI TR-03111.
-Paul Schaub <https://github.com/vanitasvitae> bringing PGPSecretKey.getUserIds() into line with PGPPublicKey.getUserIds(). Exception message fix in BcPublicKeyDataDecryptorFactory. Additional tests on PGP key ring generation. Improved functionality of PGPSignatureSubpacketGenerator, PGPPublicKeyRing. Tweaks to PGPDataEncryptorBuilder interface, fix for JcaPGP/BcPGP Ed25519 private key conversion. Added configurable CRC detection to ArmoredInputStream, additional control character skipping in ArmoredInputStream. Rewind code for PGPPBEEncryptedData, addition of PGPSignature.getDigestPrefix(). Wrong list traversal fix in PGPSecretKeyRing. Further improvement to use of generics in PGP API. General interop improvements. PGP Public / Secure keyring ignore marker packets when reading. Initial work on PGP session key handling, filtering literal data for canoncialization. Addition of direct key identified key-ring construction. PGPSecretKeyRing.insertOrReplacePublicKey addition. Addition of utility methods for joining/merging signatures and public keys. Addition of PGP regexp packet, PolicyURI packet handling, UTF8 comment testing. Efficiency improvements to TruncatedStream. Initial Argon2 support for OpenPGP. General cleanups. Fast CRC24 implementation, SHA3 addtions to BcImplProvider, improvements to One Pass Signature support, signatue validation, read() consistency in BCPGInputStream. Contributions to AEAD support (v6 & v5) in PGP API. Addition of PGP WildCard ID, moving the PGP example code into the 21st century. Security patches for encrypted data generation, initial thread safe certification verification. Support for V6 EC keys, PGP packet criticality, and Preferred AEAD CipherSuites sigsubpacket support.
+Paul Schaub <https://github.com/vanitasvitae> bringing PGPSecretKey.getUserIds() into line with PGPPublicKey.getUserIds(). Exception message fix in BcPublicKeyDataDecryptorFactory. Additional tests on PGP key ring generation. Improved functionality of PGPSignatureSubpacketGenerator, PGPPublicKeyRing. Tweaks to PGPDataEncryptorBuilder interface, fix for JcaPGP/BcPGP Ed25519 private key conversion. Added configurable CRC detection to ArmoredInputStream, additional control character skipping in ArmoredInputStream. Rewind code for PGPPBEEncryptedData, addition of PGPSignature.getDigestPrefix(). Wrong list traversal fix in PGPSecretKeyRing. Further improvement to use of generics in PGP API. General interop improvements. PGP Public / Secure keyring ignore marker packets when reading. Initial work on PGP session key handling, filtering literal data for canoncialization. Addition of direct key identified key-ring construction. PGPSecretKeyRing.insertOrReplacePublicKey addition. Addition of utility methods for joining/merging signatures and public keys. Addition of PGP regexp packet, PolicyURI packet handling, UTF8 comment testing. Efficiency improvements to TruncatedStream. Initial Argon2 support for OpenPGP. General cleanups. Fast CRC24 implementation, SHA3 addtions to BcImplProvider, improvements to One Pass Signature support, signatue validation, read() consistency in BCPGInputStream. Contributions to AEAD support (v6 & v5) in PGP API. Addition of PGP WildCard ID, moving the PGP example code into the 21st century. Security patches for encrypted data generation, initial thread safe certification verification. Support for V6 EC keys, V6 signatures, V6 encryption, V6 PKESK, PGP packet criticality, and Preferred AEAD CipherSuites sigsubpacket support. Introduce high-level OpenPGP API for message creation/consumption and certificate evaluation
Nick of Nexxar <https://github.com/nros> update to OpenPGP package to handle a broader range of EC curves.
catbref <https://github.com/catbref> sample implementation of RFC 7748/Ed25519 (incorporated work from github users Valodim and str4d as well).
gerlion <https://github.com/gerlion> detection of concurrency issue with pre-1.60 EC math library.
fgrieu <fgrieu@gmail.com> identification and suggested fixes for possible timing vulnerability in OAEPEncoding and RSACoreEngine.
MTG <https://github.com/mtgag> patch for decoding issues in PKIPublicationInfo and CertifiedKeyPair, patch for adding jurisdiction{C,ST,L} to X500 name style.
Andreas Gadermaier <up.gadermaier@gmail.com> initial version of Argon2 PBKDF algorithm.
-Tony Washer <tony.washer@yahoo.co.uk> review of qTesla, Java 1.9 module code, additional test code and debugging for GOST, DSTU, and ECNR algorithms. Initial lightweight implementation of the ZUC ciphers and macs. Additions to LMS/HSS API implementations, fix for truncation issue with big HSS keys, contributions to optimization of LMS/HSS. Patch for XDH/EdDSA key handling and mcEliece decryption using kobaraImai. Initial GCM-SIV, Blake3, and Kangaroo implementation.
+Tony Washer <https://github.com/tonywasher> ECIESKeyEncapsulation fix for use of OldCofactor mode. Submitted ChaCha20Poly1305 prototype. Remove support for maxXofLen in Kangaroo. Police Blake3 output limit. Add LEAEngine. Review of qTesla, Java 1.9 module code, additional test code and debugging for GOST, DSTU, and ECNR algorithms. Initial lightweight implementation of the ZUC ciphers and macs. Additions to LMS/HSS API implementations, fix for truncation issue with big HSS keys, contributions to optimization of LMS/HSS. Patch for XDH/EdDSA key handling and mcEliece decryption using kobaraImai. Initial GCM-SIV, Blake3, and Kangaroo implementation. Corrections to length outputs for getUpdateOutputSize()/doFinal() in ISAP, PhotonBeetle, and Xoodyak. Fix GCFB reset. Fix Elephant multi-part process. Fix AsconXof support multi-part outputs.
Vincent Bouckaert <https://github.com/veebee> initial version of RFC 4998 ASN.1 classes. Debugging and testing of high level RFC 4998 implementation.
-Tony Washer <https://github.com/tonywasher> ECIESKeyEncapsulation fix for use of OldCofactor mode. Submitted ChaCha20Poly1305 prototype. Remove support for maxXofLen in Kangaroo. Police Blake3 output limit. Add LEAEngine.
Aurimas Liutikas <https://github.com/liutikas> JavaDoc patches to ReasonsMask.
Gabriel Sroka <https://github.com/gabrielsroka> corrected comments in RSA validation.
sarah-mdv <https://github.com/sarah-mdv> improvements to JceKeyTransRecipientInfoGenerator, tests for JournalingSecureRandom, initial implementation of JournaledAlgorithm.
@@ -543,10 +542,28 @@
Bing Shi <roadicing@gmail.com> - addition of F2m bounds checking for imported EC F2m curves.
Phil Brown <https://github.com/brownp2k> - additional ant targets for building util and pkix.
Tamas Cservenak <https://github.com/cstamas> - initial patch for supporting Ed25519 keys in GnuPG S-expressions.
-chchen-scholar <https://github.com/chchen-scholar> - encoding fix for EccP256CurvePoint.
+chchen-scholar <https://github.com/chchen-scholar> - encoding fix for EccP256CurvePoint, fix missing extension EtsiTs102941TypesAuthorization.InnerAtRequest
Seung Yeon <https://github.com/seungyeonpark> - addition of Memoable method implementations to CertPathValidationContext and CertificatePoliciesValidation.
yuhh0328 <https://github.com/yuhh0328> - initial patch for adding ML-KEM support to TLS.
-Jan Oupický <https://github.com/Honzaik> - update to draft 13 of composite PQC signatures.
+Jan Oupický <https://github.com/Honzaik> - update to draft 13 of composite PQC signatures, patch for human readable algorithm name for composite private keys.
+Karsten Otto <https://github.com/ottoka> - finished the support for jdk.tls.server.defaultDHEParameters.
+Markus Sommer <https://github.com/marsom> - BCStyle lookup table fix for jurisdiction values.
+Jared Crawford <https://github.com/jmcrawford45> - Abstracting cire KEM functionality out of DHKEM to allow for use of alternative KEMs with HPKE.
+TaZbon <https://github.com/TaZbon> - Optional lax parsing patch for PEM parser.
+han-ji <https://github.com/han-jl> - Fix to sign extension issue in CTR random seek code.
+https://github.com/crlorentzen <https://github.com/crlorentzen> - Addition of system property for configuring GCM ciphers in 1.2 FIPS mode in the JSSE.
+Jakub Zelenka <https://github.com/bukka> - Initial SMIMEAuthEnvelopedData classes.
+rde-infologic <https://github.com/rde-infologic> - Initial SMIMEEnvelopedUtil class.
+moonfruit <https://github.com/moonfruit> - Patch to allow for extensions of GMSignatureSpi.
+Marcono1234 <https://github.com/Marcono1234> - Updates to OpenBSDBCrypt JavaDoc.
+DawidM <https://github.com/dawmit> - Implementation of EC J-PAKE.
+Syed Quasim <https://github.com/HawkItzme> - lint checker fix for EST getTrustAllTrustManager().
+winfriedgerlach <https://github.com/winfriedgerlach> - patch to SecretKeyUtil class, patch to DigestFactory cloner for SHA-1.
+feuxfollets1013 <https://github.com/feuxfollets1013> - Initial add JDK21 KEM API implementation for HQC algorithm.
+cragkhit <https://github.com/cragkhit> - addition of null check in some test utility methods to avoid needless exceptions.
+zhsnew <https://github.com/zhsnew> - correct AsconCXof128 implementation and add test vectors
+mt-johan <https://github.com/mt-johan> - patch to preserve PRF on initializing from protectionAlgorithm with PBMAC1.
+oscerd <https://github.com/oscerd> - comment corrections in GMSSRootSig.java.