Skip to content
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
3241 commits
Select commit Hold shift + click to select a range
81196e6
Merge branch 'pgpainless-fixHashedSubpacketsNull'
dghgit Mar 4, 2026
c39c027
Merge branch 'fixSelfSigSelection' of https://github.com/pgpainless/b…
dghgit Mar 4, 2026
657b7d0
Merge branch 'pgpainless-fixSelfSigSelection'
dghgit Mar 4, 2026
9eab8ed
Merge branch 'pgpsecretkeyV6directkeysig' of https://github.com/pgpai…
dghgit Mar 4, 2026
13ce3ad
Merge branch 'pgpainless-pgpsecretkeyV6directkeysig'
dghgit Mar 4, 2026
a1553af
Merge branch 'rsaKeyGeneration' of https://github.com/pgpainless/bc-j…
dghgit Mar 4, 2026
7b094ad
Merge branch 'pgpainless-rsaKeyGeneration'
dghgit Mar 4, 2026
94abbd5
Fix Frodo error sampling to be constant-time
peterdettman Mar 4, 2026
9643807
Refactor AESTest
peterdettman Mar 4, 2026
c6ec8c2
Use AESEngine.newInstance
peterdettman Mar 4, 2026
97fbab5
Refactoring in constant-time utils
peterdettman Mar 4, 2026
9f14109
More Pack methods
peterdettman Mar 4, 2026
5c22553
More Nat methods
peterdettman Mar 4, 2026
8692e6b
Refactoring in pqc.crypto.frodo
peterdettman Mar 4, 2026
bd43571
PKCS12KeyStoreSpi.java in tls can now write as well as read PBMAC1 pk…
Mar 5, 2026
8ce7aa8
Adaptedtls to support custom certificate types.
xipki Sep 18, 2025
91263d1
Followup for CertificateType changes (github #2165)
peterdettman Mar 5, 2026
48e8857
removed unused file, removed interal dependencies on prov module.
dghgit Mar 6, 2026
d275858
updated unit tests to track if the piped thread is stuck #2245
Mar 9, 2026
dc12926
read whole stream to prevent piped thread stuck #2245
Mar 9, 2026
8939236
fixed styling for java brackets #2245
Mar 9, 2026
5afa4ad
NTRU only in BCPQC
peterdettman Mar 9, 2026
d91537f
Use CryptoServicesRegistrar for auto-created SecureRandom
peterdettman Mar 9, 2026
c463222
Re-enable tests that need java.security conf
peterdettman Mar 9, 2026
10f2143
Fix package for jdk17 KEM tests
peterdettman Mar 9, 2026
031922a
Rename jdk17 test classes to avoid conflicts
peterdettman Mar 9, 2026
510d7e4
Rename jdk17 test classes to avoid conflicts
peterdettman Mar 9, 2026
e363a8e
CMS: Use BCPQC for NTRU tests
peterdettman Mar 9, 2026
32979da
Refactor, include some missing ".OID." entries
peterdettman Mar 9, 2026
ca8f1a9
From JDK11, test for NamedParameterSpec
peterdettman Mar 9, 2026
0093eeb
Use BCPQC for NTRU tests
peterdettman Mar 9, 2026
23646ad
Whitespace cleanup
peterdettman Mar 9, 2026
21e880b
Cleanup PKCS12-PBMAC1 changes
peterdettman Mar 9, 2026
e1993b3
Cleanup PKCS12-PBMAC1 changes
peterdettman Mar 9, 2026
36b83a6
Revert name change for gradle's sake
peterdettman Mar 9, 2026
6b98972
Cleanup warnings
peterdettman Mar 10, 2026
82df3ea
Update Falcon mappings
peterdettman Mar 10, 2026
0cc62b8
Use BCPQC for NTRU tests
peterdettman Mar 10, 2026
b5dd429
Cleanup jdk25 warnings
peterdettman Mar 10, 2026
5abd0e0
Register ".OID." variants too
peterdettman Mar 10, 2026
70dcd6c
Refactor DRBG
peterdettman Mar 10, 2026
8c5c54e
Cleanup warnings
peterdettman Mar 10, 2026
fa1cab3
Quick fix for broken tests: check jdk.tls.disableAlgorithms security …
peterdettman Mar 10, 2026
882c55e
Cleanup warnings
peterdettman Mar 10, 2026
94d11dc
Use Strings.lineSeparator
peterdettman Mar 10, 2026
c1e229b
added "the real" PKCS12-PBMAC1 key store.
dghgit Mar 11, 2026
826cee0
Merge branch 'main' of gitlab.cryptoworkshop.com:root/bc-java
dghgit Mar 11, 2026
fbe302f
minor cleanup
dghgit Mar 11, 2026
fa4336a
added setEncoding() method
dghgit Mar 11, 2026
4eb4ba6
Merge branch '2245-PipedInputStream-fix-with-getSafeInstance' of http…
dghgit Mar 11, 2026
e057cf9
Merge branch 'marijusGood-2245-PipedInputStream-fix-with-getSafeInsta…
dghgit Mar 11, 2026
64f5354
relates to github #2265
dghgit Mar 11, 2026
6b51636
added extra example test.
dghgit Mar 12, 2026
ccb059b
use FIDO_ED_25519 for parsing fido ed25519 keys
Mar 10, 2026
f2602bb
Refactoring in crypto.util
peterdettman Mar 12, 2026
5047bdf
Fix incorrect Javadoc in EllipticCurveKeyPairGenerator example.
Joowon-Seo Mar 12, 2026
eda7ebf
Fix typos in (ASN1)PKIXNameConstraintValidator
peterdettman Mar 12, 2026
8234202
Merge branch 'main' of gitlab.cryptoworkshop.com:root/bc-java
dghgit Mar 13, 2026
807bf8a
added work around property for "odd" JSAFE files.
dghgit Mar 13, 2026
e34cc8b
added mismatched curve test for ECDH.
dghgit Mar 15, 2026
0ca6c53
added test for differing MQV EC domain parameters - relates to github…
dghgit Mar 15, 2026
3883819
added test for differing MQV EC domain parameters - relates to github…
dghgit Mar 15, 2026
39e864f
minor clean up in JavaDoc
dghgit Mar 16, 2026
b0dd3c1
corrected keyWrap function to use set PRF.
dghgit Mar 18, 2026
ab7fc5e
Address PKIXNameConstraintValidator Bug
xSammyKang Feb 20, 2026
7830384
additional test for PBMAC1, fixed merge conflicts
Mar 18, 2026
645b1c7
fix the change of name
Mar 18, 2026
b4e4eb8
Followup for name constraint validation fix
peterdettman Mar 18, 2026
19150a7
Simplify MQVTest and fix error message
peterdettman Mar 18, 2026
9cc90c6
Refactor OID parsing
peterdettman Mar 23, 2026
248716d
Use helper to create AlgorithmParameters
peterdettman Mar 24, 2026
539887a
Update OID map
peterdettman Mar 24, 2026
fb2baac
Remove redundant static class specifiers
peterdettman Mar 24, 2026
b7b6a1c
Fix the issue in the pipeline
Mar 25, 2026
1f1190d
Update alt. NameConstraint validators
peterdettman Mar 25, 2026
9623c6b
Refactor NameConstraint validator classes
peterdettman Mar 25, 2026
4b6c361
Cleanup NIST CertPath tests
peterdettman Mar 25, 2026
855d507
Avoid depending on Set .toString method for error message
peterdettman Mar 25, 2026
15fc20e
Remove redundant static class specifiers
peterdettman Mar 25, 2026
9f6d911
Refactor CertPath validator classes
peterdettman Mar 25, 2026
84ba827
Restore case-sensitive filenames
peterdettman Mar 25, 2026
bb1ce2c
Add bitLength method to Integers, Longs
peterdettman Mar 26, 2026
1bd4e62
Update ASN.1 BitString from bc-csharp
peterdettman Mar 26, 2026
b914fc2
added HQC support to encapsulation lookup.
dghgit Mar 31, 2026
4ff1194
Merge branch 'main' of gitlab.cryptoworkshop.com:root/bc-java
dghgit Mar 31, 2026
11b17cc
commented out r3 only tests
dghgit Mar 31, 2026
8a471e5
changed examples to use HKDF SHA256
dghgit Mar 31, 2026
4fe9e47
Fix javadoc
peterdettman Mar 31, 2026
e19238d
Cleanup unused variables
peterdettman Mar 31, 2026
6490ec9
Add getssuerPrincipal from attr. cert.
peterdettman Mar 31, 2026
dc2684e
Refactor CertPath validator classes
peterdettman Mar 31, 2026
ac0b6c7
Fix exception messages
peterdettman Mar 31, 2026
f2528f3
Refactor RFC3280CertPathUtilities
peterdettman Mar 31, 2026
7e9c112
Use explicit boxing
peterdettman Apr 1, 2026
ffc08a7
TLS jdk1.4 updates
peterdettman Apr 1, 2026
a10b458
TLS: Improved PQC cert validation in JcaTlsCrypto
peterdettman Apr 1, 2026
da68a7e
Followup for TLS PQC validation fix
peterdettman Apr 1, 2026
5d44779
Refactor ReedSolomon.encode
peterdettman Apr 3, 2026
d4efaba
Openpgp getencryptionkeys
ligefeiBouncycastle Apr 4, 2026
fcedfe3
Merge branch 'openpgp-getEncryptionKeys' into 'main'
dghgit Apr 4, 2026
94b98de
Openpgp openpgpkeyconstructor
ligefeiBouncycastle Apr 4, 2026
fdd430a
Merge branch 'openpgp-openpgpkeyConstructor' into 'main'
dghgit Apr 4, 2026
240134e
AbstractOpenPGPDocumentSignatureGenerator: Properly apply signature c…
ligefeiBouncycastle Apr 4, 2026
80c4426
Merge branch 'openpgp-applySignatureCreationTime' into 'main'
dghgit Apr 4, 2026
ac369c1
Openpgp decryptwildcardpkesk
ligefeiBouncycastle Apr 4, 2026
0bacc55
Merge branch 'openpgp-decryptWildcardPKESK' into 'main'
dghgit Apr 4, 2026
656bae0
ensured generic composite always checks at least one signature. Added…
dghgit Apr 4, 2026
f9540ea
Merge branch 'main' of gitlab.cryptoworkshop.com:root/bc-java
dghgit Apr 4, 2026
5be47dd
removed deprecation, seems these are actually needed.
dghgit Apr 5, 2026
0976c80
removed deprecation, seems these are actually needed.
dghgit Apr 5, 2026
0252742
added system properties to allow setting of max read length and max c…
dghgit Apr 5, 2026
e1a979e
cleared property to avoid contaminating later tests.
dghgit Apr 5, 2026
65bf633
cleared property to avoid contaminating later tests.
dghgit Apr 5, 2026
00eb352
constant time/side-channel improvements
dghgit Apr 5, 2026
08e172b
added use of depth property to deal with dodgy ASN.1
dghgit Apr 5, 2026
405086a
updated providers to 1.84
dghgit Apr 6, 2026
e76a2d8
moved bike, picnic, sphincsplus, and rainbow to legacy
dghgit Apr 6, 2026
74077f8
promoted pqc/crypto/mldsa to the universal crypto package. Deprecated…
dghgit Apr 6, 2026
0503ef0
promoted pqc/crypto/mldsa to the universal crypto package. Deprecated…
dghgit Apr 6, 2026
d7c6af3
promoted mlkem to standard crypto package.
dghgit Apr 6, 2026
6fb0886
commented out legacy algorithms
dghgit Apr 7, 2026
608bc24
refactoring - simplified use of SLHDSAEngine
dghgit Apr 7, 2026
0e053a6
promoted SLHDSA to main crypto package.
dghgit Apr 7, 2026
0179acb
promoted SLHDSA to main crypto package.
dghgit Apr 7, 2026
dcf5860
correct NTRU+ from bc_sig to bc_kem.
Apr 7, 2026
127cffa
Refactoring around ASN.1 External type
peterdettman Apr 7, 2026
424d90d
More work on jdk25 KDF support
peterdettman Apr 7, 2026
091e249
Dynamic check for KEMSpi in jdk17
peterdettman Apr 7, 2026
d650f31
BCJSSE: ShangMi suites for TLS 1.3 (RFC 8998)
Feb 21, 2026
3dba8e9
ML-DSA, SLH-DSA keys are now in normal API
peterdettman Apr 8, 2026
2bb52f5
Add OpenPGPComponentSignature.verify() method
vanitasvitae Mar 10, 2026
533f7bb
Rework methods for accessing self-signatures
vanitasvitae Mar 10, 2026
94b972e
getSignatureChainFor(): Constrain chains to origin
vanitasvitae Mar 10, 2026
89d6fa1
Add methods for accessing third-party signatures for web-of-trust imp…
vanitasvitae Mar 10, 2026
dbbde9d
Add documentation for OpenPGPSignatureChain
vanitasvitae Mar 11, 2026
991c20a
Improve documentation of certification/delegation/revocation getters
vanitasvitae Mar 11, 2026
1bf44a6
Fix javadoc
vanitasvitae Mar 11, 2026
dce1e46
reformat OpenPGPCertificate
Apr 5, 2026
eb6efd0
Merge branch 'openpgp-missingGetRevocation' into 'main'
dghgit Apr 8, 2026
b9f7baa
BCJSSE: Further work on RFC 8998 (now experimental)
peterdettman Apr 8, 2026
3ed4f6f
These signers do actually do need randomness
peterdettman Apr 8, 2026
66ba74f
changed public method returning internal class in GcmSpecUtil to retu…
dghgit Apr 8, 2026
6a1a7fb
removed println
dghgit Apr 8, 2026
4371ec5
Merge branch 'main' of gitlab.cryptoworkshop.com:root/bc-java
dghgit Apr 8, 2026
2b7f1d5
PKCS12-PBMAC1 no longer needed in BCJSSE
peterdettman Apr 8, 2026
dc65548
RFC 9380 Hashing to Elliptic Curves
Razumain Nov 16, 2025
3d94239
Reformat hash2curve, minor refactoring
peterdettman Apr 8, 2026
d175373
Restore KDFAlgorithmProvider
peterdettman Apr 8, 2026
b69dbfe
Remove deprecation for BitString and OctetString parsers
peterdettman Apr 8, 2026
a5e50d3
Refactor PKCS12PfxPdu
peterdettman Apr 8, 2026
67956ab
PKCS12: Throw IOException for missing ContentInfo content
peterdettman Apr 8, 2026
fa59cc2
PKCS12: improve validation of iteration counts
peterdettman Apr 8, 2026
bf5a783
Update old jdk versions of PKCS12KeyStoreSpi
peterdettman Apr 8, 2026
7e0d85b
1.5 to 1.8 compatibility fixes.
dghgit Apr 9, 2026
346ec44
added neg iteration count test.
dghgit Apr 9, 2026
e1231ea
Guarded iterations loop
peterdettman Apr 9, 2026
970d8d4
Delegate JceTlsMLKemDomain functionality to KemUtil
peterdettman Apr 9, 2026
9b3fc33
TLS: Use javax.crypto.KEM API when available
peterdettman Apr 9, 2026
9713cb3
minor cleanup, Java 4 updates.
dghgit Apr 10, 2026
3f8d769
Merge branch 'main' of gitlab.cryptoworkshop.com:root/bc-java
dghgit Apr 10, 2026
bfd148c
minor cleanup, Java 4 updates.
dghgit Apr 11, 2026
8775f0c
correct curve lookup
dghgit Apr 11, 2026
746af49
added NTRU back, subject to final NTT feedback
dghgit Apr 11, 2026
39118aa
minor cleanup, Java 4 and 5 updates.
dghgit Apr 11, 2026
cad3ace
marked SPHINCSPlus and Dilithium for deprecation.
dghgit Apr 11, 2026
76e0136
moved to 1.84
dghgit Apr 12, 2026
4dedef1
added CVE numbers
dghgit Apr 13, 2026
ebcf060
Update release notes for 1.84
peterdettman Apr 13, 2026
c3cbbef
initial update
dghgit Apr 14, 2026
dc45902
update release notes for openpgp, SM2/4 and NTRU+
Apr 14, 2026
ee68871
final updates
dghgit Apr 15, 2026
4da25d5
format issue
dghgit Apr 15, 2026
a523239
typo...
dghgit Apr 15, 2026
22847da
added missing CVE
dghgit Apr 15, 2026
cbfe765
corrected CVE number
dghgit Apr 15, 2026
d716d77
fixed typo in CVE
dghgit Apr 15, 2026
00df193
moved to 1.0.24 - fips 23 releases now going out.
dghgit Apr 16, 2026
b2e7520
increased MAX_CONS_DEPTH to 64 - turns out 32 is not big enough.
dghgit Apr 21, 2026
f3623fb
increased MAX_CONS_DEPTH to 64 - turns out 32 is not big enough.
dghgit Apr 21, 2026
0d29783
Refactoring in tls tests
peterdettman Apr 21, 2026
9225e08
Cleanup in tls
peterdettman Apr 21, 2026
dd9e383
Cleanup in tls
peterdettman Apr 21, 2026
4c59cc8
Refactor PKCS#12 code
peterdettman Apr 21, 2026
c7fb857
Add parameterless constructor for ScryptWithUTF8
peterdettman Apr 22, 2026
ffa28e4
ASN.1: Rework depth and limit checking
peterdettman Apr 22, 2026
34645f5
added Mayo support to CMS/PKIX
dghgit Apr 22, 2026
6925874
Merge branch 'main' of gitlab.cryptoworkshop.com:root/bc-java
dghgit Apr 22, 2026
9a8ee88
added property for limiting Argon2 memory usage - relates to github #…
dghgit Apr 23, 2026
b7eaf8f
moved to 1.85 beta release
dghgit Apr 23, 2026
41989f9
removed bizzare inclusion of old pqc factory. Relates to github #2287
dghgit Apr 23, 2026
33716ca
added support for MAYO-N naming
dghgit Apr 24, 2026
d7f7d95
updated section numbers, added 1.85
dghgit Apr 24, 2026
50b45d9
added new Argon2 property
dghgit Apr 24, 2026
1ff948a
added support for MAYO-N naming
dghgit Apr 24, 2026
4eb637c
fixed memory range check
dghgit Apr 28, 2026
3c50bb1
Improve exception messages
peterdettman Apr 29, 2026
631242f
Refactor prov build.gradle
peterdettman Apr 29, 2026
0197957
Refactor CMSSignedHelper
peterdettman Apr 29, 2026
1c0cf75
ecdsa_plain_SHA1 => noParams for consistency
peterdettman Apr 29, 2026
c459037
Update noParams list in NewSIgnedDataTest
peterdettman Apr 29, 2026
82c183c
Refactoring in cert.ocsp
peterdettman Apr 29, 2026
d083987
Merge branch 'main' of gitlab.cryptoworkshop.com:root/bc-java
dghgit May 1, 2026
8a32189
rationalised ProvRecovationOscpChecker relates to github #2254
dghgit May 1, 2026
2aa0926
rationalised ProvRecovationOscpChecker relates to github #2254
dghgit May 1, 2026
1939817
Refactor ASN1Boolean
peterdettman May 1, 2026
dd44ecb
added support for PBEKey storage, relates to #2164
dghgit May 1, 2026
d37c5d9
added support additional setters, relates to #1545
dghgit May 1, 2026
67cbc0d
Merge branch 'main' of gitlab.cryptoworkshop.com:root/bc-java
dghgit May 1, 2026
bba6163
Update StreamUtil in old java versions
peterdettman May 1, 2026
d30f6bb
Reduce tmp buffers used by ASN1InputStream
peterdettman May 1, 2026
a5409ad
corrected padding, relates to #2214
dghgit May 1, 2026
106ab8f
Merge branch 'main' of gitlab.cryptoworkshop.com:root/bc-java
dghgit May 2, 2026
295d8dc
added CMS support for RFC 8418, relates to #1845.
dghgit May 2, 2026
9f73faf
generalised BlockPool support in Argon2, relates to github #1647
dghgit May 2, 2026
af79374
Added use of Exceptions class to propogate cause, relates to github #…
dghgit May 2, 2026
9a3ce13
Added use of Exceptions class to propogate cause, relates to github #…
dghgit May 2, 2026
a08bb94
Added use of Exceptions class to propogate cause for IllegalStateExce…
dghgit May 2, 2026
bf11c90
Corrected casing of Falcon naming when used with NamedParameterSpec, …
dghgit May 2, 2026
eda070d
Corrected casing of Falcon naming when used with NamedParameterSpec, …
dghgit May 2, 2026
0a31f6c
re-added old composite lookup - needs to be deprecated out.
dghgit May 2, 2026
467cac8
annotated return with TODO - relates to github #837
dghgit May 2, 2026
2f7f39a
added missing names - relates to github #1763
dghgit May 2, 2026
b71f930
updated test for message check to use cause.
dghgit May 2, 2026
02fc493
updated test for message check to use cause.
dghgit May 2, 2026
4b2c49f
added mode support to SM2, relates to github #1302
dghgit May 2, 2026
0a01811
added SM2 patch
dghgit May 2, 2026
5086e68
corrected expiry time check to allow for later packets which increase…
dghgit May 2, 2026
b80da46
Fixed case issues in Falcon name.
dghgit May 2, 2026
4e28866
Updated validity test.
dghgit May 3, 2026
153da24
Added legacy parsing of encrypted EdEC keys. Relates to github #1238
dghgit May 3, 2026
6b169b3
Added use of Exceptions class to propogate cause for IOException, rel…
dghgit May 3, 2026
eaebef1
Added cause to GeneralSecurityException throw, relates to github #2250
dghgit May 3, 2026
527488a
Added null check to prevent attempt to validate trust anchor without …
dghgit May 3, 2026
22e9e8d
Added additional methods to SimplePKIResponse and builder class, rela…
dghgit May 3, 2026
cf2f521
Added basic KeyGrip calculator for RSA keys, relates to github #676
dghgit May 3, 2026
5490432
Added support for SM2 as a CMS KeyTransport cipher, relates to github…
dghgit May 3, 2026
cbfae08
Added certificate based SM2 test, relates to github #584
dghgit May 3, 2026
31fe836
Initial support for SecretBag, relates to github #890
dghgit May 3, 2026
a46adf3
Added PBMAC1 support to pkcs package MAC verifier provider.
dghgit May 3, 2026
63a0d11
Added name and OID search, relates to github #1230
dghgit May 4, 2026
a0aeb44
initial CLAUDE.md
dghgit May 4, 2026
790ac4b
removed possible recursion on misconfigured CertPath validations, rel…
dghgit May 4, 2026
aa7d3f6
generalized openSSH ECDSA key encoding, relates to github #2240
dghgit May 4, 2026
71ede26
tweak on misconfigured CertPath validations, relates to github #2291
dghgit May 4, 2026
cace5d1
re-added commented out tests.
dghgit May 4, 2026
c7f57bd
added missing tests
dghgit May 4, 2026
65e218e
added missing tests
dghgit May 4, 2026
c2cb354
added external hash to HashMLDSASigner, relates to github #2198
dghgit May 4, 2026
c2c5d52
Update SLHDSAParameters.java
chen-cht May 5, 2026
f67f7ef
Update SLHDSAEngine.java
chen-cht May 5, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1226,14 +1226,16 @@ public OpenPGPSignatureChains getSignatureChains()
}

/**
* Return the (at evaluation time) latest certification signature binding this component.
* Return the (at evaluation time) latest self certification signature binding this component.
*
* @param evaluationTime reference time
* @return latest component certification signature
*/
public OpenPGPComponentSignature getCertification(Date evaluationTime)
{
OpenPGPSignatureChain certification = getSignatureChains().getCertificationAt(evaluationTime);
OpenPGPSignatureChain certification = getSignatureChains()
.fromOrigin(getCertificate().getPrimaryKey())
.getCertificationAt(evaluationTime);
if (certification != null)
{
return certification.getSignature();
Expand All @@ -1242,14 +1244,16 @@ public OpenPGPComponentSignature getCertification(Date evaluationTime)
}

/**
* Return the (at evaluation time) latest revocation signature revoking this component.
* Return the (at evaluation time) latest self revocation signature revoking this component.
*
* @param evaluationTime reference time
* @return latest component revocation signature
*/
public OpenPGPComponentSignature getRevocation(Date evaluationTime)
{
OpenPGPSignatureChain revocation = getSignatureChains().getRevocationAt(evaluationTime);
OpenPGPSignatureChain revocation = getSignatureChains()
.fromOrigin(getCertificate().getPrimaryKey())
.getRevocationAt(evaluationTime);
if (revocation != null)
{
return revocation.getSignature();
Expand Down Expand Up @@ -1529,7 +1533,9 @@ public Date getKeyExpirationDateAt(Date evaluationTime)
*/
protected OpenPGPSignature.OpenPGPSignatureSubpacket getApplyingSubpacket(Date evaluationTime, int subpacketType)
{
OpenPGPSignatureChain binding = getSignatureChains().getCertificationAt(evaluationTime);
OpenPGPSignatureChain binding = getSignatureChains()
.fromOrigin(getCertificate().getPrimaryKey())
.getCertificationAt(evaluationTime);
if (binding == null)
{
// is not bound
Expand Down Expand Up @@ -2132,7 +2138,9 @@ public Date getCreationTime()
@Override
public OpenPGPComponentSignature getLatestSelfSignature(Date evaluationTime)
{
OpenPGPSignatureChain currentDKChain = getSignatureChains().getChainAt(evaluationTime);
OpenPGPSignatureChain currentDKChain = getSignatureChains()
.fromOrigin(getCertificate().getPrimaryKey())
.getChainAt(evaluationTime);
if (currentDKChain != null && !currentDKChain.chainLinks.isEmpty())
{
return currentDKChain.getSignature();
Expand Down Expand Up @@ -2318,7 +2326,9 @@ public OpenPGPComponentSignature getLatestDirectKeySelfSignature()
*/
public OpenPGPComponentSignature getLatestDirectKeySelfSignature(Date evaluationTime)
{
OpenPGPSignatureChain currentDKChain = getCertificate().getAllSignatureChainsFor(this)
OpenPGPSignatureChain currentDKChain = getCertificate()
.getAllSignatureChainsFor(this)
.fromOrigin(this)
.getCertificationAt(evaluationTime);
if (currentDKChain != null && !currentDKChain.chainLinks.isEmpty())
{
Expand Down Expand Up @@ -2346,7 +2356,9 @@ public OpenPGPComponentSignature getLatestKeyRevocationSelfSignature()
*/
public OpenPGPComponentSignature getLatestKeyRevocationSelfSignature(Date evaluationTime)
{
OpenPGPSignatureChain currentRevocationChain = getCertificate().getAllSignatureChainsFor(this)
OpenPGPSignatureChain currentRevocationChain = getCertificate()
.getAllSignatureChainsFor(this)
.fromOrigin(this)
.getRevocationAt(evaluationTime);
if (currentRevocationChain != null && !currentRevocationChain.chainLinks.isEmpty())
{
Expand Down Expand Up @@ -2695,7 +2707,9 @@ public OpenPGPPrimaryKey getPrimaryKey()
@Override
public OpenPGPComponentSignature getLatestSelfSignature(Date evaluationTime)
{
OpenPGPSignatureChain currentChain = getSignatureChains().getChainAt(evaluationTime);
OpenPGPSignatureChain currentChain = getSignatureChains()
.fromOrigin(getPrimaryKey())
.getChainAt(evaluationTime);
if (currentChain != null && !currentChain.chainLinks.isEmpty())
{
return currentChain.getSignature();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import org.bouncycastle.openpgp.PGPException;
import org.bouncycastle.openpgp.PGPObjectFactory;
import org.bouncycastle.openpgp.PGPSignature;
import org.bouncycastle.openpgp.PGPSignatureException;
import org.bouncycastle.openpgp.PGPSignatureList;
import org.bouncycastle.openpgp.PGPSignatureSubpacketGenerator;
import org.bouncycastle.openpgp.api.OpenPGPApi;
Expand Down Expand Up @@ -49,6 +50,8 @@ protected void performTestWith(OpenPGPApi api)
testSKSignsPKRevokedNoSubpacket(api);
testPKSignsPKRevocationSuperseded(api);
testGetPrimaryUserId(api);

testIgnoreThirdPartySigsForSelfSigs(api);
}

private void testOpenPGPv6Key(OpenPGPApi api)
Expand Down Expand Up @@ -879,6 +882,35 @@ public String getMsg()
}
}

private void testIgnoreThirdPartySigsForSelfSigs(OpenPGPApi api)
throws IOException, PGPSignatureException
{
String certWith3rdPartyUIDSig = "-----BEGIN PGP PUBLIC KEY BLOCK-----\n" +
"Comment: 2933 CBF1 9C19 5FEC C3D8 F6BB 7875 DF0D 34D8 0659\n" +
"Comment: Alice\n" +
"\n" +
"mCYEaUKQbBvoc5joeGZFjSjl2LoEuEfTn4dzNPkF68PUTROte/Yn2LQFQWxpY2XC\n" +
"cQQTGwoAHRahBCkzy/GcGV/sw9j2u3h13w002AZZBYJpQpBsAAoJEHh13w002AZZ\n" +
"XM1wwAo+gEchltvtokJUM2alG9z/iCOzBVs7WONrPo5rDJb+RRXXhVz+Mw1lYGWo\n" +
"USe86sZiTnjThA+Ech7JZdoHwnUEEBYKACcFgmlCnn0JEG2VRHjfrsFLFqEE2gJf\n" +
"vjCRGba1de0nbZVEeN+uwUsAAM3RAP0fEo5u5CdRg849xsNYAPv1oHT03el6LyGc\n" +
"Bk44oz7INgD/cFTufapwXJJB5IRX+lJA84w++6Xg0SS9h9TBmQBMiw24JgRpQpBs\n" +
"GyB6+bOfuk3Xaqlv2y9W08EiasmbznRLVaPhlLYTdNzCwsAnBBgbCgCTFqEEKTPL\n" +
"8ZwZX+zD2Pa7eHXfDTTYBlkFgmlCkGwCmwJyoAQZGwoAHRahBB7oLGA9/n/GLv02\n" +
"vM2YyJHfn7e+BYJpQpBsAAoJEM2YyJHfn7e+b0/C2Cv/ujgLxz3TOGi5rTFW7LQ+\n" +
"8vxC25T7ryBmnXaBdZvv0dBvOXy7MpSzRIrgxJQQWpoDNLHFZKosEGYCCUwKAAoJ\n" +
"EHh13w002AZZLI0VnHaOFQRwf+6BCOD/+0d9JhYAOh6nP24pAc0kTeZ7UHZusysk\n" +
"SfhI5KGG2gFUEJlItnagBCsIzxV0GwFoLSwAuCYEaUKQbBnAZbXB6dCd6LT+HeS6\n" +
"1Js5qhp7S+GPhFW4MfGeCBU/F8J0BBgbCgAgFqEEKTPL8ZwZX+zD2Pa7eHXfDTTY\n" +
"BlkFgmlCkGwCmwwACgkQeHXfDTTYBllHw49G2YdupzV1pu1qk4KXgDtsVQumEthi\n" +
"fOXKC8sGfUZASw5bPNFMcWfT/nFrzmuvi01DD+pfUo9a8GoRAZ6qSQ0=\n" +
"=oG2x\n" +
"-----END PGP PUBLIC KEY BLOCK-----";

OpenPGPCertificate cert = api.readKeyOrCertificate().parseCertificate(certWith3rdPartyUIDSig);
cert.getUserId("Alice").getCertification(new Date()).verify(api.getImplementation());
}

public static void main(String[] args)
{
runTest(new OpenPGPCertificateTest());
Expand Down