Skip to content

Commit

Permalink
PDFBOX-5936: refactor for future change
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.apache.org/repos/asf/pdfbox/trunk@1923250 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
THausherr committed Jan 20, 2025
1 parent 0b7570d commit db453e3
Showing 1 changed file with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -370,19 +370,22 @@ private void fetchCrlData(CertSignatureInformation certInfo) throws IOException
private void addOcspData(CertSignatureInformation certInfo) throws IOException, OCSPException,
CertificateProccessingException, RevokedCertificateException, URISyntaxException
{
if (ocspChecked.contains(certInfo.getCertificate()))
X509Certificate certificate = certInfo.getCertificate();
X509Certificate issuerCertificate = certInfo.getIssuerCertificate();
String ocspURL = certInfo.getOcspUrl();
if (ocspChecked.contains(certificate))
{
// This certificate has been OCSP-checked before
return;
}
OcspHelper ocspHelper = new OcspHelper(
certInfo.getCertificate(),
certificate,
signDate.getTime(),
certInfo.getIssuerCertificate(),
issuerCertificate,
new HashSet<>(certInformationHelper.getCertificateSet()),
certInfo.getOcspUrl());
ocspURL);
OCSPResp ocspResp = ocspHelper.getResponseOcsp();
ocspChecked.add(certInfo.getCertificate());
ocspChecked.add(certificate);
BasicOCSPResp basicResponse = (BasicOCSPResp) ocspResp.getResponseObject();
X509Certificate ocspResponderCertificate = ocspHelper.getOcspResponderCertificate();
certInformationHelper.addAllCertsFromHolders(basicResponse.getCerts());
Expand Down Expand Up @@ -424,7 +427,7 @@ private void addOcspData(CertSignatureInformation certInfo) throws IOException,
{
correspondingOCSPs.add(ocspStream);
}
foundRevocationInformation.add(certInfo.getCertificate());
foundRevocationInformation.add(certificate);
}

/**
Expand Down

0 comments on commit db453e3

Please sign in to comment.