Skip to content

Commit

Permalink
added check for empty extensions - relates to github bcgit#1548
Browse files Browse the repository at this point in the history
  • Loading branch information
dghgit committed Dec 13, 2023
1 parent 17eec86 commit 223edac
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions prov/src/main/java/org/bouncycastle/jce/provider/OcspCache.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
import org.bouncycastle.asn1.x509.Extensions;
import org.bouncycastle.jcajce.PKIXCertRevocationCheckerParameters;
import org.bouncycastle.jcajce.util.JcaJceHelper;
import org.bouncycastle.util.BigIntegers;
import org.bouncycastle.util.io.Streams;

class OcspCache
Expand Down Expand Up @@ -142,8 +141,16 @@ static OCSPResponse getOcspResponse(
}

// TODO: configure originator
TBSRequest tbsReq = new TBSRequest(null, new DERSequence(requests),
Extensions.getInstance(new DERSequence(requestExtensions)));
TBSRequest tbsReq;
if (requestExtensions.size() != 0)
{
tbsReq = new TBSRequest(null, new DERSequence(requests),
Extensions.getInstance(new DERSequence(requestExtensions)));
}
else
{
tbsReq = new TBSRequest(null, new DERSequence(requests), (Extensions)null);
}

org.bouncycastle.asn1.ocsp.Signature signature = null;

Expand Down

0 comments on commit 223edac

Please sign in to comment.