mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
8255348: NPE in PKIXCertPathValidator event logging code
Reviewed-by: mullan
This commit is contained in:
parent
a97f3c18d5
commit
18eb6d9e34
6 changed files with 76 additions and 25 deletions
|
@ -241,13 +241,13 @@ public final class PKIXCertPathValidator extends CertPathValidatorSpi {
|
|||
X509ValidationEvent xve = new X509ValidationEvent();
|
||||
if (xve.shouldCommit() || EventHelper.isLoggingSecurity()) {
|
||||
int[] certIds = params.certificates().stream()
|
||||
.mapToInt(x -> x.hashCode())
|
||||
.mapToInt(Certificate::hashCode)
|
||||
.toArray();
|
||||
int anchorCertId =
|
||||
anchor.getTrustedCert().hashCode();
|
||||
int anchorCertId = (anchorCert != null) ?
|
||||
anchorCert.hashCode() : anchor.getCAPublicKey().hashCode();
|
||||
if (xve.shouldCommit()) {
|
||||
xve.certificateId = anchorCertId;
|
||||
int certificatePos = 1; //anchor cert
|
||||
int certificatePos = 1; // most trusted CA
|
||||
xve.certificatePosition = certificatePos;
|
||||
xve.validationCounter = validationCounter.incrementAndGet();
|
||||
xve.commit();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue