Skip to content

Commit 99a0765

Browse files
committed
amend(OCSP): allow more than one responder certificate in OCSP response
WE2-703 Signed-off-by: Mart Somermaa <[email protected]>
1 parent aabf1b9 commit 99a0765

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<modelVersion>4.0.0</modelVersion>
66
<artifactId>authtoken-validation</artifactId>
77
<groupId>org.webeid.security</groupId>
8-
<version>2.0.0</version>
8+
<version>2.0.1-SNAPSHOT</version>
99
<packaging>jar</packaging>
1010
<name>authtoken-validation</name>
1111
<description>Web eID authentication token validation library for Java</description>

src/main/java/eu/webeid/security/validator/certvalidators/SubjectCertificateNotRevokedValidator.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,11 @@ private void verifyOcspResponse(BasicOCSPResp basicResponse, OcspService ocspSer
139139
// We assume that the responder includes its certificate in the certs field of the response
140140
// that helps us to verify it. According to RFC 2560 this field is optional, but including it
141141
// is standard practice.
142-
if (basicResponse.getCerts().length != 1) {
143-
throw new UserCertificateOCSPCheckFailedException("OCSP response must contain one responder certificate, "
144-
+ "received " + basicResponse.getCerts().length + " certificates instead");
142+
if (basicResponse.getCerts().length < 1) {
143+
throw new UserCertificateOCSPCheckFailedException("OCSP response must contain the responder certificate, "
144+
+ "but none was provided");
145145
}
146+
// The first certificate is the responder certificate, other certificates, if given, are the certificate's chain.
146147
final X509CertificateHolder responderCert = basicResponse.getCerts()[0];
147148
OcspResponseValidator.validateResponseSignature(basicResponse, responderCert);
148149

0 commit comments

Comments
 (0)