Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
4051 commits
Select commit Hold shift + click to select a range
f89eca5
further S2K work
dghgit Jun 22, 2026
7bf20ee
Escape X.500 RDN values in linear time
dghgit Jun 22, 2026
27c468a
Escape DN values in the jdk1.4 LDAPStoreHelper LDAP filter
dghgit Jun 22, 2026
99ddc6d
Reject CMS SignedData with no signers in verifySignatures
dghgit Jun 22, 2026
4b8169c
another minor refactor
dghgit Jun 22, 2026
6e98a3b
additional refactoring around S2K usage
dghgit Jun 22, 2026
5376dc1
Disable Error Prone on test sources
dghgit Jun 22, 2026
ac00bab
Fix StringIndexOutOfBoundsException parsing a malformed EST auth chal…
ligefeiBouncycastle Jun 22, 2026
ff433cf
Merge branch 'est-httputil-parse-bounds' into 'main'
ligefeiBouncycastle Jun 22, 2026
d71d224
Use constant-time comparison for secret-bearing private-key `equals()`
ligefeiBouncycastle Jun 22, 2026
055b762
Merge branch 'ct-equals-private-keys' into 'main'
ligefeiBouncycastle Jun 22, 2026
6e5a609
Compare BigIntegers.constantTimeAreEqual operands as common-length un…
Jun 23, 2026
1c834a0
Validate encoding length in PQC public key parameter decode constructors
Jun 23, 2026
fd7c604
Guard five OpenPGP signature subpackets against truncated bodies at p…
Jun 23, 2026
2edb0ff
Guard PQC verifySignature against malformed-length signatures
Jun 23, 2026
1dafbf7
Validate encoding length in PQC public key parameter decode constructors
Jun 23, 2026
faf5daa
Gate loading of legacy 16-bit-MAC BKS v0/v1 keystores behind enable_v…
dghgit Jun 23, 2026
881f13c
Document the constant-time contract of BigIntegers.constantTimeAreEqual
ligefeiBouncycastle Jun 23, 2026
b70dbeb
Merge branch 'bigintegers-ct-contract' into 'main'
Jun 23, 2026
0ffbdc5
Verify CRL signatures in lightweight cert-path CRLValidation before t…
dghgit Jun 23, 2026
449e7a3
Merge branch 'main' of gitlab.cryptoworkshop.com:root/bc-java
dghgit Jun 23, 2026
a0495d6
Add Argon2 (RFC 9106) SecretKeyFactory to the BC JCE provider
dghgit Jun 23, 2026
946f40f
Route the OpenPGP jcajce Argon2 S2K path through SecretKeyFactory ARG…
dghgit Jun 23, 2026
c35fb7a
Zero the temporary unsigned encodings in BigIntegers.constantTimeAreE…
dghgit Jun 23, 2026
a29cfb4
Fix HQC parameter-spec name round-trip and make the dash form the pri…
dghgit Jun 23, 2026
00d8ede
Standardised Classic McEliece (ISO/IEC 18033-2:2006/Amd 2:2026)
ligefeiBouncycastle Jun 23, 2026
fa6fde3
Merge branch 'cmce-iso18033' into 'main'
Jun 23, 2026
e932113
Merge branch 'main' of gitlab.cryptoworkshop.com:root/bc-java
dghgit Jun 23, 2026
0dfee46
Add lightweight crypto.util key-info round-trip test with id-kem-cm O…
dghgit Jun 23, 2026
500cb0d
Implement ProvSSLSession.getRequestedServerNames so a server can read…
Jun 23, 2026
d9cbfd9
added missing test
Jun 23, 2026
315fb25
fixed GCM/CCM processing issue with generic method
dghgit Jun 24, 2026
e6095cb
Merge branch 'main' of gitlab.cryptoworkshop.com:root/bc-java
dghgit Jun 24, 2026
1430ad2
add comments
Jun 24, 2026
2a5b929
Reject CR/LF at the ArmoredOutputStream and PemWriter header sinks
Jun 24, 2026
45f116a
Restrict BCJSSE HTTPS endpoint-identification wildcards to the left-m…
Jun 24, 2026
cb4893d
Avoid unnecessary BigInteger roundtrip
peterdettman Jun 24, 2026
b757130
Implement getEncoded via encodeTo
peterdettman Jun 24, 2026
766c175
Add ECDHRawAgreement and use
peterdettman Jun 24, 2026
acc0d48
Refactor custom Fp curves
peterdettman Jun 24, 2026
0520dc7
More work on raw agreements (to avoid BigInteger roundtrips)
peterdettman Jun 24, 2026
724326d
Extract separate IETFUtilsTest
peterdettman Jun 24, 2026
7d6d75a
Merge branch 'jsse-hostname-leftmost-wildcard-fix' into 'main'
Jun 24, 2026
00755bf
added HMAC-SM3 vector test
dghgit Jun 24, 2026
4042e0e
minor reformating.
dghgit Jun 25, 2026
a2cff32
Allow CMS recipients to restrict accepted content-encryption algorith…
dghgit Jun 25, 2026
69c1345
Merge branch 'main' of gitlab.cryptoworkshop.com:root/bc-java
dghgit Jun 25, 2026
3b51a74
Fix intermittent NTRU+ KEM decapsulation failure: use R mod q in the …
Jun 25, 2026
ecf39e7
Guard five fixed-arity CMP/CRMF/CMS SEQUENCE decode constructors (Pro…
Jun 25, 2026
fc699b5
Reject a truncated composite-signature private key shorter than the 3…
Jun 25, 2026
ac337a2
Reject negative-length and malformed-hex canonical S-expression conte…
Jun 25, 2026
06cf138
Bound the attacker-controlled element count in MLSInputStream.readArr…
Jun 25, 2026
2e283fb
Fix javadoc
peterdettman Jun 25, 2026
66c1668
Encode directly
peterdettman Jun 25, 2026
5d3f78c
attempt to minimise accidental private value exposure.
dghgit Jun 26, 2026
dbf3c1c
Merge branch 'main' of gitlab.cryptoworkshop.com:root/bc-java
dghgit Jun 26, 2026
48bc1e2
added minimal tag length check
dghgit Jun 26, 2026
0fefa53
Allow CMS recipients to require a minimum AEAD tag size, refusing sho…
dghgit Jun 26, 2026
22b9137
Use gcmAlgs/ccmAlgs OID tables for the CMS AEAD algorithm checks, rec…
dghgit Jun 26, 2026
43e8100
Enable ARIA/SM4 GCM/CCM for CMS AuthEnvelopedData round-tripping and …
dghgit Jun 26, 2026
3b2503b
Make KCCM decryption output plaintext only rather than plaintext plus…
dghgit Jun 26, 2026
ea0ea82
Consolidate content-encryption OID membership tests into OidCatalogue
dghgit Jun 26, 2026
88a47d4
Don't ignore keySize for RC2
peterdettman Jun 26, 2026
8980786
Make it clearer contentType is null
peterdettman Jun 26, 2026
a29849e
Include contentType
peterdettman Jun 26, 2026
9b40dcf
Guard OCSP CertID decode constructor with a lower-bound sequence-size…
Jun 26, 2026
8a3ef5f
Guard OCSP ResponseBytes decode constructor with a lower-bound sequen…
Jun 26, 2026
eaebba1
Guard bc.PbkdMacIntegrityCheck decode constructor with a lower-bound …
Jun 26, 2026
4fe0581
Guard four fixed-arity CMS SEQUENCE decode constructors (CompressedDa…
Jun 26, 2026
ae19e62
Guard the DER-octet-string heuristic in IvAlgorithmParameters.engineI…
Jun 26, 2026
46afc67
Reject out-of-range ProtocolVersion/WireFormat index in MLSMessage de…
Jun 26, 2026
293e490
Guard for CMS SEQUENCE
Jun 26, 2026
2d21055
Allocate ephemeral ports in JSSE provider tests instead of hardcoded …
dghgit Jun 27, 2026
f429007
Split XMSS, SLHDSA, CMCE, Hawk, FAEST, MQOM, SNOVA and QRUOV tests in…
dghgit Jun 27, 2026
185d288
Merge branch 'main' of gitlab.cryptoworkshop.com:root/bc-java
dghgit Jun 27, 2026
27d55ac
added fork setting, added sampling to SLH-DSA test
dghgit Jun 27, 2026
f98b0c7
added calcTestForks
dghgit Jun 27, 2026
9912127
refactored out slow tests for parallel execution.
dghgit Jun 27, 2026
154927e
CMS: It's just "algorithm protection" attribute
peterdettman Jun 27, 2026
e7047a6
Add AttributeTable.hasAny method
peterdettman Jun 27, 2026
2cf2af0
Refactor SIgnerInformation
peterdettman Jun 27, 2026
6b21544
Refactor CMSAuthenticatedData
peterdettman Jun 27, 2026
a4a3109
Read S-Expression canonical string length incrementally to avoid pre-…
dghgit Jun 27, 2026
0aa2511
Merge branch 'main' of gitlab.cryptoworkshop.com:root/bc-java
dghgit Jun 27, 2026
84cba75
Generalise canonical-string read into Streams.readLenBytesFully and a…
dghgit Jun 27, 2026
cbf5b27
Remove unused legacy SXprUtils S-expression helper, relates to github…
dghgit Jun 27, 2026
0948a3b
EthereumIESEngine: close static-key stream-mode cross-message MAC for…
ligefeiBouncycastle Jun 27, 2026
14a64f4
Merge branch 'ethereum-ies-static-key-fix' into 'main'
Jun 27, 2026
4c56032
Merge branch 'armor-pem-header-injection-fix' into 'main'
Jun 27, 2026
b6496f2
MLS SecureRandom hygiene: source from the Group / registrar, never `n…
ligefeiBouncycastle Jun 27, 2026
56c6489
Merge branch 'mls-securerandom-sweep' into 'main'
Jun 27, 2026
f99a41e
GF(2^8) / GF(2^4) arithmetic consolidation onto constant-time util.GF…
ligefeiBouncycastle Jun 27, 2026
953ecde
Merge branch 'alg-gf256-dedup' into 'main'
Jun 27, 2026
9b7ada7
EAX / CCM / OCB / KCCM: reject nonce reuse on re-init for encryption
ligefeiBouncycastle Jun 27, 2026
b65ba5f
Merge branch 'aead-nonce-reuse-guard' into 'main'
Jun 27, 2026
409c939
AIMer
ligefeiBouncycastle Jun 28, 2026
62b2c35
Merge branch 'kpqc-aimer' into 'main'
Jun 28, 2026
c146fca
ElGamalEngine: validate ciphertext components on decryption (small-su…
ligefeiBouncycastle Jun 28, 2026
9e8991f
Merge branch 'elgamal-peer-value-validation' into 'main'
Jun 28, 2026
4371f61
Fix `PKIXCertPathReviewer.getPolicyTree()` always returning `null`
ligefeiBouncycastle Jun 28, 2026
24e0103
Merge branch 'pkix-getpolicytree-fix' into 'main'
Jun 28, 2026
3a03043
Reject empty GeneralSubtrees/GeneralSubtree sequences in X.509 NameCo…
dghgit Jun 28, 2026
211fd23
KCCM: Decryption input length guard
peterdettman Jun 28, 2026
98dc30f
RFC 8702 — SHAKE in CMS: KMAC-with-SHAKE support
ligefeiBouncycastle Jun 28, 2026
86626df
Merge branch 'rfc-8702-shake-cms' into 'main'
Jun 28, 2026
efe1030
KCCM/KGCM: Improve parameter type and reuse checks
peterdettman Jun 28, 2026
4fb18ac
Enforce the RFC 9106 Argon2 memory-size-exponent floor at key derivation
ligefeiBouncycastle Jun 28, 2026
6fc7c13
Merge branch 'argon2-memory-exponent-floor' into 'main'
Jun 28, 2026
413d481
GF256AES: Optimize mul, sqr methods
peterdettman Jun 28, 2026
407693a
Refactor ElGamalEngine
peterdettman Jun 28, 2026
cbac5bb
DVCS: carry `requester` and `extensions` forward in the `DVCSRequestI…
ligefeiBouncycastle Jun 29, 2026
8a2e78c
Merge branch 'dvcs-request-info-builder-seed-fix' into 'main'
Jun 29, 2026
db0e123
Harden GnuPG keybox blob parsing against malformed input
ligefeiBouncycastle Jun 29, 2026
13178fc
Merge branch 'keybox-cert-blob-bounds' into 'main'
Jun 29, 2026
5a42f0b
fix a stale-buffer bug on the signing retry path
Jun 29, 2026
fa6dd4a
OpenPGP: reject malformed dash-prefixed lines in cleartext-signed (CS…
ligefeiBouncycastle Jun 29, 2026
8f9908c
Merge branch '2329-openpgp-csf-dash-escape' into 'main'
Jun 29, 2026
df4ef8f
ChaCha20Poly1305: improve init parameter checks
peterdettman Jun 29, 2026
5b606f0
Fix possible integer overflow
peterdettman Jun 29, 2026
1642e9d
Refactoring in bcpg and openpgp tests
peterdettman Jun 29, 2026
a4ebade
Guard OCSP RevokedInfo, SingleResponse and Signature decode construct…
Jun 29, 2026
8c6581d
Guard four fixed-arity ASN.1 SEQUENCE decode constructors (cms.Attrib…
Jun 29, 2026
9aff128
ECIES: Fix mac update length and cleanup
peterdettman Jun 29, 2026
c5dcb89
pass build1-5to1-8
Jun 29, 2026
dfa5a2d
Merge branch 'legacy-builds' into 'main'
ligefeiBouncycastle Jun 30, 2026
745c793
Correct MessageDigestUtils digest name for the RIPEMD-256 OID
Jun 30, 2026
ebf67f8
Merge branch 'main' into legacy-properties-overlay-sync
Jun 30, 2026
b8986fa
build-provider + build-libraries green
Jun 30, 2026
c2fefda
Pass java 1.4 test package.
Jun 30, 2026
7ce90dd
Merge branch 'messagedigestutils-ripemd256-name-fix' into 'main'
Jun 30, 2026
24db505
Bound the legacy PBES1 / PBKDF1 iteration count in the pkix PBE decry…
Jun 30, 2026
cbcbc86
Merge remote-tracking branch 'origin/main' into pbes1-pbkdf1-operator…
Jun 30, 2026
a5b3fd9
Add comment
peterdettman Jun 30, 2026
ade3d4f
Cap the CMS PasswordRecipient PBKDF2 iteration count (CPU-DoS guard)
ligefeiBouncycastle Jun 30, 2026
29d25c5
Merge branch 'claude/serene-bouman-77ade5' into 'main'
Jun 30, 2026
0caf423
#33+#34+#37 bug fix
Jun 30, 2026
f25c114
Merge branch 'main' into openssl-pem-parse-ioexception
Jun 30, 2026
9eb7fdb
Use a constant-time MAC compare in the CMSAuthenticatedDataParser jav…
Jun 30, 2026
e260a06
Wrap RuntimeException from the PKCS12 engineLoad MAC-data parse as IO…
Jun 30, 2026
7c77de4
Wrap RuntimeException from the CMSSignedData parse as CMSException
Jun 30, 2026
2134ca9
Wrap RuntimeException from the CMSSignedData parse as CMSException
Jun 30, 2026
b29107b
Reject a top-level SECRET_SUBKEY packet in PGPObjectFactory.nextObjec…
ligefeiBouncycastle Jun 30, 2026
913ef61
Merge branch 'pg-objectfactory-secret-subkey-ioexception' into 'main'
Jun 30, 2026
3826620
Surface a malformed IssuingDistributionPoint extension from X509CRLHo…
ligefeiBouncycastle Jun 30, 2026
4cdf7c6
Merge branch 'x509crlholder-idp-parse-ioexception' into 'main'
Jun 30, 2026
87ce888
Cap the BKS keystore load iteration count to prevent a pre-integrity-…
ligefeiBouncycastle Jun 30, 2026
a919761
Merge branch 'bks-keystore-iteration-cap' into 'main'
Jun 30, 2026
72fce66
Cap the PKCS#12-PBE iteration count in the pkix operator / OpenSSL PK…
ligefeiBouncycastle Jun 30, 2026
b709460
Merge branch 'pkcs12-pbe-operator-iteration-cap' into 'main'
Jun 30, 2026
8bc1876
Merge branch 'main' into openssl-pem-parse-ioexception
Jul 1, 2026
8a7f525
Merge branch 'main' into pkcs12-cms-parse-runtimeexception-leak
Jul 1, 2026
de0d4d4
Merge branch 'refs/heads/main' into pqc-pubkey-length-validation
Jul 1, 2026
bf06265
Merge branch 'main' into pqc-verify-malformed-input-hardening
Jul 1, 2026
52ba533
Merge branch 'main' into pg-sig-subpacket-length-guard
Jul 1, 2026
07a811b
Update CMCE and FrodoKEM
Jul 1, 2026
c4b24fe
Validate encoding length in PQC public key parameter decode constructors
Jul 1, 2026
34e9fce
Merge branch 'main' into lms-hss-sig-parse-npe-fix
Jul 1, 2026
a38e460
Merge branch 'pqc-verify-malformed-input-hardening' into pqc-pubkey-l…
Jul 1, 2026
bf86812
replaced IllegalStateException with IllegalArgumentException as adver…
dghgit Jul 1, 2026
f0049a9
Reject malformed MLS external-join messages instead of crashing with …
ligefeiBouncycastle Jul 1, 2026
1414d5d
Merge branch 'mls-newmember-verify-npe-fix' into 'main'
Jul 1, 2026
f828a0b
Merge branch 'main' of gitlab.cryptoworkshop.com:root/bc-java
dghgit Jul 1, 2026
e757665
Corrected BIP-340 step numbering in BIP340Signer signing comments, re…
dghgit Jul 1, 2026
c7185cf
replaced IllegalStateException with IllegalArgumentException as adver…
dghgit Jul 1, 2026
c046171
Revert "Wrap RuntimeException from the CMSSignedData parse as CMSExce…
Jul 1, 2026
5f3c410
Merge branch 'main' into pkcs12-cms-parse-runtimeexception-leak
Jul 1, 2026
28ba229
Convert malformed-inner-content IllegalArgumentException to CMSExcept…
ligefeiBouncycastle Jul 1, 2026
49dfc18
Merge branch 'cms-auth-decode-robustness' into 'main'
Jul 1, 2026
aaf287d
Merge branch 'main' into pg-sig-subpacket-length-guard
Jul 1, 2026
9a5d1db
Refactor withinDNSubtree
peterdettman Jul 1, 2026
eba0e61
ASN.1: New fromExplicit method(s) for casts in parsing context
peterdettman Jul 1, 2026
3a402b8
Guard TimeStampResp / TimeStampReq against a too-short SEQUENCE (pars…
ligefeiBouncycastle Jul 1, 2026
da9a22e
Merge branch 'tsp-request-response-parse-guard' into 'main'
Jul 1, 2026
34b5282
Merge branch 'main' into pqc-pubkey-length-validation
dghgit Jul 1, 2026
b8fa7a3
Merge branch 'main' into pkcs12-cms-parse-runtimeexception-leak
dghgit Jul 1, 2026
314e626
Validate ciphertext length in eight PQC KEM decapsulators before deco…
ligefeiBouncycastle Jul 1, 2026
80b14cb
Merge branch 'pqc-kem-ciphertext-length-validation' into 'main'
Jul 1, 2026
caaa307
Align CMS malformed-content-tag test with the IllegalArgumentExceptio…
dghgit Jul 1, 2026
25f6188
Merge branch 'main' of gitlab.cryptoworkshop.com:root/bc-java
dghgit Jul 1, 2026
75b0a0a
Merge branch 'main' into openssl-pem-parse-ioexception
dghgit Jul 1, 2026
c8b108b
Merge branch 'main' into lms-hss-sig-parse-npe-fix
dghgit Jul 1, 2026
14aa21d
Merge branch 'main' into pg-sig-subpacket-length-guard
dghgit Jul 2, 2026
6d009ec
Speed up ARIA (ARIAEngine) ~1.3–1.4× via SWAR multiply-broadcast diff…
ligefeiBouncycastle Jul 2, 2026
5461f34
Merge branch 'alg-aria-refactor' into 'main'
Jul 2, 2026
a96ef42
Merge branch 'main' into pqc-paramspec-fromname-fix
dghgit Jul 2, 2026
94ee4f4
Merge branch 'main' of gitlab.cryptoworkshop.com:root/bc-java
dghgit Jul 2, 2026
ca74bb8
CMS: check for extraneous data in byte arrays
peterdettman Jul 2, 2026
2176f86
Expand name-constraint bypass tests
peterdettman Jul 2, 2026
f872d4f
Added generateCbom/generateSbom Gradle tasks producing reproducible C…
dghgit Jul 2, 2026
f43a9b7
Merge branch 'main' of gitlab.cryptoworkshop.com:root/bc-java
dghgit Jul 2, 2026
c22de8b
Edit .gitlab-ci.yml removed trigger for spongy castle
Jul 2, 2026
2444502
Merge branch 'main' into pqc-xwing-export-and-aes-cleanup
dghgit Jul 2, 2026
6cf1668
added a nested exception on failure in SubjectPublicKeyInfo creation …
dghgit Jul 2, 2026
8241a48
Remove remaining vestigial Dilithium-AES references: unused Dilithium…
dghgit Jul 2, 2026
0b4d29e
Merge branch 'main' of gitlab.cryptoworkshop.com:root/bc-java
dghgit Jul 2, 2026
d1977d4
Reject ambiguous multi-'@' rfc822Name tested names in nameConstraints
peterdettman Jul 2, 2026
3253175
Documented SBOM/CBOM generation in README.md and brought build instru…
dghgit Jul 2, 2026
a35bf0f
Merge branch 'main' into legacy-properties-overlay-sync
dghgit Jul 2, 2026
d9889a3
Restore a green build1-4 (jdk1.4) build and test run following the me…
dghgit Jul 3, 2026
6854a62
Sync the jdk1.4 overlays with base, porting missed security and behav…
dghgit Jul 3, 2026
f5de1c8
added use of priveledged action
dghgit Jul 3, 2026
9bf4a57
Merge branch 'main' of gitlab.cryptoworkshop.com:root/bc-java
dghgit Jul 3, 2026
8db136f
X.509 name-parse robustness (COV-4 / COV-6)
ligefeiBouncycastle Jul 3, 2026
ebdcea8
Merge branch 'x509-name-parse-robustness' into 'main'
dghgit Jul 3, 2026
c71b283
Mirror X509_ALLOW_LENIENT_RFC822_NAME into the jdk1.4 Properties over…
dghgit Jul 3, 2026
a4f00b1
Add docs/claude/build-jdk14.md covering the build1-4 legacy build: so…
dghgit Jul 3, 2026
4139886
Complete XMSS/XMSS^MT SP 800-208 support and move asn1.iana into core…
dghgit Jul 3, 2026
80fa867
Be lenient about the ASN.1 string type for an SGP22 EUM IIN (serialNu…
peterdettman Jul 3, 2026
37094e5
Grow ASN.1 definite-length objects incrementally via Streams.readLenB…
dghgit Jul 4, 2026
115e852
Merge branch 'main' of gitlab.cryptoworkshop.com:root/bc-java
dghgit Jul 4, 2026
fb3fd82
RFC 9734 implementation
Jun 2, 2026
b2a3e52
Add a KeyPurposeId OID unit test covering the recently-added Extended…
dghgit Jul 4, 2026
c43e578
Move the ASN.1 max-construction-depth and max-length stream property …
dghgit Jul 4, 2026
99a9eaf
CMS: type-check asn1.cms.Attribute decode (no ClassCastException past…
ligefeiBouncycastle Jul 4, 2026
34244f7
Merge branch 'cms-attribute-type-guard' into 'main'
dghgit Jul 4, 2026
cd1d88f
Reject a key whose tree digest is outside the named XMSS/XMSS^MT sign…
dghgit Jul 5, 2026
c93b376
moved to 1.85 release
dghgit Jul 6, 2026
a8b7832
Merge branch 'main' of gitlab.cryptoworkshop.com:root/bc-java
dghgit Jul 6, 2026
7b2c325
Export the new org.bouncycastle.crypto.bls package from the provider …
dghgit Jul 6, 2026
9b58957
Cleaned up 1.85 release notes: removed duplicated policy-tree and Fal…
dghgit Jul 6, 2026
7ff53a9
Removed the Dilithium, SPHINCSPlus and Kyber JCE wrappers from the BC…
dghgit Jul 6, 2026
29ae9ee
Added JCA/JCE provider test coverage for AIMer and a BC-provider key-…
dghgit Jul 6, 2026
be08d30
Made the SDitH engines package-private in line with the other PQC eng…
dghgit Jul 6, 2026
2112905
Removed the unreferenced Hawk NTRUProfile and BLS12_381Fp classes and…
dghgit Jul 6, 2026
79853c5
Removed the unused org.bouncycastle.iana.AEADAlgorithm constants clas…
dghgit Jul 6, 2026
bf1f59f
Removed stale ext module descriptor exports for long-deleted legacy P…
dghgit Jul 6, 2026
73fcb0a
Brought internal CMSOBjectIdentifiers in line with util, corrected re…
dghgit Jul 6, 2026
2be1777
Added missing 1.85 release note entries: AC signature verification, N…
dghgit Jul 6, 2026
b1a7e78
Fixed HTML defects in CONTRIBUTORS.html (premature list-item close or…
dghgit Jul 6, 2026
6790a22
Export org.bouncycastle.jcajce.provider.asymmetric.compositekem from …
dghgit Jul 6, 2026
49bb5cf
Brought docs/specifications.html up to date with the current algorith…
dghgit Jul 6, 2026
f08c13e
added note about deprecated PQC implementations
dghgit Jul 6, 2026
5fe1ec0
Fixed jdk1.4/legacy Ant builds: restored asn1.iana in the provider fi…
dghgit Jul 6, 2026
89054f3
Fixed jdk18+/legacy Ant test builds: signer-info clash on package-pri…
dghgit Jul 6, 2026
c45097e
Fixed jdk15to18 build: declare the captured tooShort local final in P…
dghgit Jul 6, 2026
e2fa0f3
Resynced the jdk1.5 BaseBlockCipher overlay with base: it had rotted …
dghgit Jul 6, 2026
4b58ed7
Added lms/mayo/sdith test excludes to jdk15+.xml core test fileset, m…
dghgit Jul 6, 2026
527624f
CMSSignedData.replaceSigners/addDigestAlgorithm recompute the SignedD…
dghgit Jul 7, 2026
082fa17
Fixed keybox Blob.getInstance treating an EMPTY_BLOB as end-of-file, …
dghgit Jul 7, 2026
48a0a0a
Harden asn1.cms.SignerInfo decode to reject a non-INTEGER version or …
dghgit Jul 7, 2026
064fd52
Reject empty SEQUENCE in the RFC 5280 SEQUENCE SIZE (1..MAX) X.509 ex…
dghgit Jul 7, 2026
df26a27
Credited digi-scrypt in CONTRIBUTORS and added a release note for the…
dghgit Jul 7, 2026
9961e6f
Give RevocationTest's eeCertWithDistPoint a valid non-empty CRL distr…
Jul 7, 2026
d520021
Made the X509RevocationChecker soft-fail hard limit inclusive (failHa…
dghgit Jul 7, 2026
eb7ad2e
Replaced the CMS SignedData version-preservation property with a CMSS…
dghgit Jul 7, 2026
9197bc4
Fixed an off-by-4 header-length guard in NotationData.verifyData: the…
dghgit Jul 8, 2026
b2b4fba
Exercise the SPHINCS+ OID encode/decode round-trip for the -simple va…
dghgit Jul 8, 2026
2151d2e
deleted unnecessary file
dghgit Jul 8, 2026
257799a
Extended the generateCbom fallback primitive classification to cover …
dghgit Jul 9, 2026
ffbad4b
OPS packet: Default to new packet format
vanitasvitae Jul 9, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
301 changes: 301 additions & 0 deletions .claude/skills/bcpqc-add-signature-algorithm/SKILL.md

Large diffs are not rendered by default.

114 changes: 114 additions & 0 deletions .claude/skills/build-jdk15to18/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
---
name: build-jdk15to18
description: Build, sign, and test the legacy jdk15to18 (Java 5) distribution via the build1-5to1-8 script and ant/jdk15+.xml. Use this whenever the user wants to build/sign/run the "build1-5to1-8" version, get "sh build1-5to1-8 test" to pass, reproduce a genuine-Java-5 compile or test failure, or chase a "JCE cannot authenticate the provider BC" / NoSuchMethodError / NoClassDefFoundError that only shows up on a real JRE 5. Captures the build→sign→test ordering, the two different JDKs involved, the machine-only signing step, and the compile-time vs runtime Java-version traps that the modern Gradle build cannot surface.
---

# Building, signing and testing the jdk15to18 (Java 5) distribution

The legacy `jdk15to18` artifact is a **1.5-bytecode** jar built on **JDK 8** and run on a **genuine JRE 5**. That split is the source of every non-obvious problem here: code that compiles fine (JDK 8 resolves all APIs) can still fail at runtime on JRE 5 because the API didn't exist in 1.5. The Gradle build (`--release 8`) cannot catch any of this; only this pipeline can.

This skill is for driving `sh build1-5to1-8` and getting `sh build1-5to1-8 test` green.

## The three steps — order matters

```
sh build1-5to1-8 # 1. BUILD on JDK 8 -> unsigned jars
/home/dgh/bin/bcsign build/artifacts/jdk1.5/jars/*.jar # 2. SIGN (this machine only)
sh build1-5to1-8 test # 3. TEST on genuine JRE 5
```

**The build clobbers signatures.** `sh build1-5to1-8` (no arg) rewrites every jar in `build/artifacts/jdk1.5/jars/` unsigned. So you must always **build → sign → test**, in that order. Never run the no-arg build again after signing without re-signing.

**`test` does not rebuild the provider.** The `test` target only compiles the *test* tree and runs JUnit against the already-built (and signed) jars. So you can re-run `sh build1-5to1-8 test` as many times as you like without re-signing — only a no-arg rebuild forces a re-sign.

### Step 1 — build (JDK 8)

`sh build1-5to1-8` sets `JAVA_HOME=$JDKPATH` (default `/usr/lib/jvm/java-8-openjdk-amd64`) and runs `ant -f ant/jdk15+.xml build-provider build`, producing in `build/artifacts/jdk1.5/jars/`:
`bcprov`, `bcprov-ext`, `bcutil`, `bcpkix`, `bcpg`, `bcmail`, `bcjmail`, `bctls`, `bctest` (`-jdk15to18-<ver>.jar`).
The `<javac>` is `source/target=1.5`, `fork="true"`, **no `bootclasspath`** — so it compiles against JDK 8's libraries. That is why API-availability problems are invisible at this stage.

If you only need to iterate on the test compile, `build-provider` alone is *not* enough — `asn1.cmc`/`asn1.cmp`/etc. tests need `bcutil`/`bcpkix`, so run the full no-arg build at least once.

### Step 2 — sign (only works on this machine)

`/home/dgh/bin/bcsign <jars...>` signs in place with BC's release keys:
- It hardcodes `JAVA_HOME=java-7` (needs `pack200`, removed in JDK 14+).
- For names matching `jdk15|jdk16|fips` it `pack200 --repack`s then double-signs (RSA-2048 `bcrsa2048key` + 1024 `bc1024key`) against keystores under `/home/dgh/bc/` with a timestamp authority, then verifies.
- The keystores, passwords and certs live only on this machine, so **signing cannot be reproduced elsewhere** — on any other host the crypto tests cannot pass under a genuine JRE 5.

Sign the whole jar dir: `/home/dgh/bin/bcsign build/artifacts/jdk1.5/jars/*.jar`.

**Why signing is mandatory:** on JDK 5 the JCE requires providers performing `Cipher`/`Mac`/`KeyGenerator` work to be jars signed with a trusted JCE code-signing cert. An unsigned dev jar makes essentially every crypto test fail with `java.lang.SecurityException: JCE cannot authenticate the provider BC` (pure-ASN.1 suites still pass, which is the tell).

### Step 3 — test (genuine JRE 5)

The `test` branch of `build1-5to1-8` switches `JAVA_HOME=$JDK5PATH` (`/usr/lib/jvm/java-1.5.0-oracle-i586`) and runs `ant -f ant/jdk15+.xml test`: it copies+overlays sources, compiles the test tree with **genuine javac 1.5**, then runs the `**/AllTests.java` suites under **JRE 5**. Reports land in `build/artifacts/jdk1.5/reports/xml/TEST-*.xml` (parse these for failures — the console only prints `Test <suite> FAILED`).

## Two distinct classes of failure

### (a) Compile-time — genuine javac 1.5 rejects the test source

Test files using post-1.5 APIs must be excluded from the genuine-Java-5 compile in `ant/jdk15+.xml` (add an `<exclude>` to the `prov/src/test/java` fileset) **and** dropped from the genuine-Java-5 suite overlays under `prov/src/test/jdk1.5/` (the build copies the main tree then overlays `jdk1.5` with `overwrite="true"`, so the overlay `RegressionTest`/`AllTests` are what actually compile). Known excludes already in place:
- `jce/provider/test/AEADTest.java`, `jcajce/provider/test/LEATest.java` — `javax.crypto.spec.GCMParameterSpec` (Java 7).
- `jce/provider/test/X509LDAPCertStoreTest.java` — pulls `com.unboundid.ldap...` from `unboundid-ldapsdk-6.0.8.jar`, which is **Java 7 bytecode** (`class file has wrong version 51.0, should be 49.0`).

Main-source genuine-Java-5 overlays live under `<module>/src/main/jdk1.5/` (e.g. `core/src/main/jdk1.5/.../i18n/LocalizedMessage.java` avoids Java 6 `ResourceBundle.Control`). The no-arg build masks the need for these (JDK 8 has the API); only a genuine-javac-1.5 compile reveals them.

To check a single file fast without the whole pipeline, compile against the real Java 5 bootclasspath:
```
J5=/usr/lib/jvm/java-1.5.0-oracle-i586
"$J5/bin/javac" -source 1.5 -target 1.5 \
-bootclasspath "$J5/jre/lib/rt.jar:$J5/jre/lib/jce.jar:$J5/jre/lib/jsse.jar" \
-sourcepath <tree> -d /tmp/out <File>.java
```
(Include `jce.jar`/`jsse.jar` — `javax.crypto.*` / `javax.net.ssl.*` are not in `rt.jar` on JDK 5.)

**Excluding a test from the JRE-5 run.** The build copies the main test tree then overlays `<module>/src/test/jdk1.5/` with `overwrite="true"`. Two cases:
- A `*AllTests`/`*Test` discovered by the batchtest, or one constructed in an `AllTests` method: the offending class can fail to even *load* on JRE 5 (the bytecode verifier resolves a JDK-7/8 type referenced in a method body at class-load time, so a guard *inside* the method never runs). So you must drop it from the **suite**, via a `jdk1.5` overlay of the enclosing `AllTests`/`RegressionTest` (e.g. `prov/src/test/jdk1.5/.../RegressionTest.java`, `pkix/src/test/jdk1.5/.../cert/ocsp/test/AllTests.java`). The overlay must list every test *except* the excluded one (it replaces, not merges). Add the module's `src/test/jdk1.5` to the `overwrite` copy block in `ant/jdk15+.xml` if it isn't already (prov/tls/pg were wired; core/pkix were added during the 1.85 pass).
- A `SimpleTest` run only via `RegressionTest.tests` (e.g. `crypto.test.RSATest`): a `RegressionTest` overlay would duplicate ~200 entries, so a **runtime guard inside the test** keyed on `System.getProperty("java.version").startsWith("1.5")` is cleaner (it still runs on JDK 8/21). Used for the `RSATest` JIT case below.

### (b) Runtime — target-1.5 bytecode calls an API absent on JRE 5

These compile cleanly (JDK 8 has the API) and only surface as JUnit `NoSuchMethodError`/`NoClassDefFoundError` on JRE 5. **The BC util wrappers `Longs`/`Integers`/`BigIntegers` exist precisely for this** — they have `jdk1.5` overlays that reimplement the Java-7/8 method in a 1.5-safe way, so the fix is usually "route the static call through the wrapper" (and, if the wrapper lacks the method, add it to both the main class and its `jdk1.5` overlay). Confirmed fixes from the 1.85 pass:

| Java-7/8 API (symptom) | Java-5-safe fix |
|---|---|
| `new IOException(String,Throwable)` / `IOException(Throwable)` (Java 6) | `Exceptions.ioException(msg,cause)`; for an `IOException` subclass ctor `super(msg); initCause(cause);` |
| `BigInteger.longValueExact()` (Java 8) | `BigIntegers.longValueExact(x)` |
| `Long.parseUnsignedLong/compareUnsigned/divideUnsigned`, `Integer.compare` (Java 7/8) | `Longs.*` / `Integers.*` (add to main **and** `jdk1.5` overlay if missing) |
| `Math.getExponent`/`Math.scalb` (Java 6) | full `jdk1.5` overlay of the class (e.g. `Dpe`) with exact ports; keep main on `Math.*` |
| `SecretKey.destroy()` (Java 8 — `SecretKey extends Destroyable` only since 8) | `if (key instanceof Destroyable) ((Destroyable)key).destroy();` (the interface is Java 1.4) |
| `StandardCharsets` / `String.getBytes(Charset)` / `new String(byte[],Charset)` (Java 6/7) | `Strings.toByteArray` / charset-*name* (`String`) overloads |
| `java.util.Arrays.copyOf` / `copyOfRange` (Java 6) | `System.arraycopy` (BC `org.bouncycastle.util.Arrays.copyOf` has only primitive/`BigInteger` overloads) |
| `ResourceBundle.Control` (Java 6) | `jdk1.5` overlay; emulate no-fallback by pinning `Locale.setDefault(loc)` across `getBundle` |
| `PKIXRevocationChecker`/`java.security.cert.Extension` (Java 8) | not portable — version-gate the provider registration / exclude the test |

Audit grep before shipping a change: `longValueExact()`, `new IOException(` with a 2nd arg (and `extends IOException` ctors), `StandardCharsets`, `getBytes(java.nio.charset`, `\bLong\.(parseUnsigned|compareUnsigned|divideUnsigned)`, `Integer.compare`, `Math.(getExponent|scalb)`, `java.util.Arrays.copyOf`, `\.destroy\(\)` on `SecretKey`, `ResourceBundle.Control`, `java.security.cert.PKIXRevocationChecker`. **mls is not in this build** — ignore its hits.

Note: `@Override` on an *interface*-method implementation is a genuine-javac-1.5 error, but the real build compiles under JDK 8 (`-source 1.5`, lenient), so it is **not** a blocker — don't churn those.

### (c) JVM defect — JRE 5's JIT miscompiles correct code

Not every JRE-5-only failure is a Java-version-API problem. The Oracle 1.5.0_22 i586 HotSpot **JIT miscompiles `org.bouncycastle.math.raw.Mod.modOddIsCoprimeVar`** (the safegcd routine behind `BigIntegers.hasAnySmallFactors`) once that path warms up — so `RSATest`'s small-factor modulus rejection silently doesn't fire. The bytecode is correct (passes on JDK 21 and under the 1.5 **interpreter**). Diagnostic recipe to classify any suspicious JRE-5 failure:

```
J5=/usr/lib/jvm/java-1.5.0-oracle-i586
CP=build/artifacts/jdk1.5/jars/bcprov-jdk15to18-*.jar:build/artifacts/jdk1.5/jars/bctest-jdk15to18-*.jar
"$J5/bin/java" -cp "$CP" <SimpleTest fqcn> # genuine JIT -> reproduces
"$J5/bin/java" -Xint -cp "$CP" <SimpleTest fqcn> # interpreter -> if it PASSES, it's a JIT bug, not a BC bug
$JAVA_HOME/bin/java -cp "$CP" <SimpleTest fqcn> # JDK 21 -> if it PASSES, not a logic bug
```

If `-Xint` passes but JIT fails, it's a JVM defect — don't "fix" the BC code; guard the affected assertion on `java.version` 1.5 (see exclusion note above) and document it.

## Quick reference

| Need | Command |
|---|---|
| Full build (JDK 8) | `sh build1-5to1-8` |
| Sign (this machine) | `/home/dgh/bin/bcsign build/artifacts/jdk1.5/jars/*.jar` |
| Test (JRE 5) | `sh build1-5to1-8 test` |
| Clean | `sh build1-5to1-8 clean` |
| Failure detail | `build/artifacts/jdk1.5/reports/xml/TEST-*.xml` |

Overriding JDKs: `JDKPATH` (build JDK, default 8) and `JDK5PATH` (test JRE, default the oracle i586 5) are read from the environment by `build1-5to1-8`.
4 changes: 2 additions & 2 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
34 changes: 32 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,21 @@
.gradle
.project

junit*.properties
*.class
*.gen
*/*.gen
*.swp
*.iml
*/*.iml
*.ipr
*.iws

bin/
build/
*/build/
dist/
libs/*.jar
out/
*/out/
.settings/
Expand All @@ -21,10 +26,35 @@ pg/*.bak
pg/*.bpg
pg/*.txt

.idea
.idea/

.DS_Store

mail/*.message
mail/id.p12

codesigning.jks

/prov/src/main/core/

bc-build.user.properties
bc-build.user.properties

# macOS Finder metadata
.DS_Store

# Claude Code: ignore personal/local state, but share team tooling
# (skills, slash commands, subagents, and project settings.json).
.claude/*
!.claude/settings.json
!.claude/skills/
!.claude/commands/
!.claude/agents/
.claude/settings.local.json
.claude 2/

# Stray test-run output left at the top of modules
/example.p12
/mail/*.p12
/mail/*.message
/prov/ells
/tls/ells
80 changes: 60 additions & 20 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,70 @@
stages:
- check
- build
- test
- sync

check-code:
stage: check
script:
- "apply_overlay bc-java ./"
- ". cienv.sh; \ gradle check -x test;"

test-code-8:
stage: test
script:
- "apply_overlay bc-java ./"
- "sh gettestdata.sh"
- ". cienv-8.sh; \ gradle -stacktrace clean build;"

test-code-11:
stage: test
- "ecr_login"
- "ecr_pull vm_base_intel latest"
- "ci_docker_run \"vm_base_intel:latest\" \"bc-java\" \"/workspace/bc-java/ci/check_java.sh\""
artifacts:
when: always
paths:
- "core/build/reports"
- "prov/build/reports"
- "pg/build/reports"
- "pkix/build/reports"
- "mail/build/reports"
- "util/build/reports"
- "tls/build/reports"
- "mls/build/reports"

ant-build:
stage: build
needs: [ "check-code" ]
script:
- "apply_overlay bc-java ./"
- "sh gettestdata.sh"
- ". cienv-11.sh; \ gradle -stacktrace clean build;"

test-code-17:
- "ecr_login"
- "ecr_pull vm_base_intel latest"
- "ci_docker_run \"vm_base_intel:latest\" \"bc-java\" \"/workspace/bc-java/ci/build_1_8.sh\""


test-code:
stage: test
needs: [ "check-code" ]
script:
- "apply_overlay bc-java ./"
- "sh gettestdata.sh"
- ". cienv-17.sh; \ gradle -stacktrace clean build;"
- "ecr_login"
- "ecr_pull vm_base_intel latest"
- "ci_docker_run \"vm_base_intel:latest\" \"bc-java\" \"/workspace/bc-java/ci/test.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"


#publish:
# stage: publish
# rules:
# - if: $CI_COMMIT_BRANCH == "main"
# 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/pub.sh\""

# spongycastle:
# stage: "sync"
# rules:
# - if: $CI_COMMIT_BRANCH == "main"
# script:
# - "syncpongy.sh"
10 changes: 10 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

The detailed guidance is split across the files below (imported automatically). Add new guidance to the file whose topic it fits, and create a new `docs/claude/<topic>.md` + import line here when a genuinely new topic appears.

- @docs/claude/build-and-test.md — driving the Gradle build, running individual tests fast, the stash-the-fix verification discipline.
- @docs/claude/build-jdk14.md — the jdk1.4 (build1-4) legacy build: source preprocessing (what the regexes fix and what they can't), the real-1.4-javac compile floor, overlay delete-vs-sync discipline, the build → bcsign4 → test flow and its signing/staleness traps.
- @docs/claude/architecture.md — module graph and the `core`-into-`prov` trap, MR-jar overlays, `module-info.java` / `package-info.java` upkeep, where examples live, JCE provider registration, adding a PQC algorithm, `.bc` vs `.jcajce` package layering.
- @docs/claude/conventions.md — test conventions, X.509 / ASN.1 RFC discipline, strict cert parse vs reviewer, DER lenient-read/strict-write, exception-message contract, `SecurityExceptions` cause-chaining, property constants, non-standard interop, PKCS#12 SPI pair, CMS streaming I/O, operator close discipline, duplicated OID tables, release notes, commit messages, URL checking, code style.
Loading