Skip to content

Commit 68151ea

Browse files
metsmamrts
authored andcommitted
Nonce support was added to EstEID 2015
All ID-Card certificates are expired in the EstEID 2015 OCSP service WE2-839 Signed-off-by: Raul Metsma <[email protected]>
1 parent 948373b commit 68151ea

File tree

5 files changed

+6
-11
lines changed

5 files changed

+6
-11
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ import eu.webeid.security.challenge.ChallengeNonceStore;
100100

101101
You must explicitly specify which **intermediate** certificate authorities (CAs) are trusted to issue the eID authentication and OCSP responder certificates. CA certificates can be loaded from either the truststore file, resources or any stream source. We use the [`CertificateLoader`](https://github.com/web-eid/web-eid-authtoken-validation-java/blob/main/src/main/java/eu/webeid/security/certificate/CertificateLoader.java) helper class to load CA certificates from resources here, but consider using [the truststore file](https://github.com/web-eid/web-eid-spring-boot-example/blob/main/src/main/java/eu/webeid/example/config/ValidationConfiguration.java#L104-L123) instead.
102102

103-
First, copy the trusted certificates, for example `ESTEID-SK_2015.cer` and `ESTEID2018.cer`, to `resources/cacerts/`, then load the certificates as follows:
103+
First, copy the trusted certificates, for example `ESTEID2018.cer`, to `resources/cacerts/`, then load the certificates as follows:
104104

105105
```java
106106
import java.security.cert.X509Certificate;
@@ -109,7 +109,7 @@ import eu.webeid.security.certificate.CertificateLoader;
109109
...
110110
private X509Certificate[] trustedIntermediateCACertificates() {
111111
return CertificateLoader.loadCertificatesFromResources(
112-
"cacerts/ESTEID-SK_2015.cer", "cacerts/ESTEID2018.cer");
112+
"cacerts/ESTEID2018.cer");
113113
}
114114
...
115115
```
@@ -301,7 +301,7 @@ The following additional configuration options are available in `AuthTokenValida
301301
- `withOcspClient(OcspClient ocspClient)` - uses the provided OCSP client instance during user certificate revocation check with OCSP. The provided client instance must be thread-safe. This gives the possibility to either configure the request timeouts, proxies etc of the `OkHttpClient` instance used by `OkHttpOcspClient` or provide an implementation that uses an altogether different HTTP client, for example the built-in `HttpClient` provided by Java 9+. See examples in `OcspClientOverrideTest`.
302302
- `withOcspRequestTimeout(Duration ocspRequestTimeout)` – sets both the connection and response timeout of user certificate revocation check OCSP requests. Default is 5 seconds.
303303
- `withDisallowedCertificatePolicies(ASN1ObjectIdentifier... policies)` – adds the given policies to the list of disallowed user certificate policies. In order for the user certificate to be considered valid, it must not contain any policies present in this list. Contains the Estonian Mobile-ID policies by default as it must not be possible to authenticate with a Mobile-ID certificate when an eID smart card is expected.
304-
- `withNonceDisabledOcspUrls(URI... urls)` – adds the given URLs to the list of OCSP responder access location URLs for which the nonce protocol extension will be disabled. Some OCSP responders don't support the nonce extension. Contains the ESTEID-2015 OCSP responder URL by default.
304+
- `withNonceDisabledOcspUrls(URI... urls)` – adds the given URLs to the list of OCSP responder access location URLs for which the nonce protocol extension will be disabled. Some OCSP responders don't support the nonce extension.
305305

306306
Extended configuration example:
307307

src/main/java/eu/webeid/security/util/DateAndTime.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public static void requirePositiveDuration(Duration duration, String fieldName)
4545

4646
public static class DefaultClock implements Clock {
4747

48-
// Allows mocking of time-dependent behavior with Mockito.mockStatic().
48+
// Allows mocking of time-dependent behavior with Mockito.mockStatic() in tests.
4949
private static final Clock instance = new DefaultClock();
5050

5151
public static Clock getInstance() {

src/main/java/eu/webeid/security/validator/AuthTokenValidationConfiguration.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838

3939
import static eu.webeid.security.util.Collections.newHashSet;
4040
import static eu.webeid.security.util.DateAndTime.requirePositiveDuration;
41-
import static eu.webeid.security.validator.ocsp.OcspUrl.AIA_ESTEID_2015;
4241

4342
/**
4443
* Stores configuration parameters for {@link AuthTokenValidatorImpl}.
@@ -57,8 +56,7 @@ public final class AuthTokenValidationConfiguration {
5756
SubjectCertificatePolicies.ESTEID_SK_2015_MOBILE_ID_POLICY_V3,
5857
SubjectCertificatePolicies.ESTEID_SK_2015_MOBILE_ID_POLICY
5958
);
60-
// Disable OCSP nonce extension for EstEID 2015 cards by default.
61-
private Collection<URI> nonceDisabledOcspUrls = newHashSet(AIA_ESTEID_2015);
59+
private Collection<URI> nonceDisabledOcspUrls = new HashSet<>();
6260

6361
AuthTokenValidationConfiguration() {
6462
}

src/main/java/eu/webeid/security/validator/ocsp/OcspUrl.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@
3737

3838
public final class OcspUrl {
3939

40-
public static final URI AIA_ESTEID_2015 = URI.create("http://aia.sk.ee/esteid2015");
41-
4240
/**
4341
* Returns the OCSP responder {@link URI} or an empty {@code Optional} if it doesn't have one.
4442
*/

src/test/java/eu/webeid/security/testutil/OcspServiceMaker.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040
import static eu.webeid.security.testutil.Certificates.getTestEsteid2018CA;
4141
import static eu.webeid.security.testutil.Certificates.getTestSkOcspResponder2020;
4242
import static eu.webeid.security.util.Collections.newHashSet;
43-
import static eu.webeid.security.validator.ocsp.OcspUrl.AIA_ESTEID_2015;
4443

4544
public class OcspServiceMaker {
4645

@@ -74,7 +73,7 @@ public static OcspServiceProvider getDesignatedOcspServiceProvider(String ocspSe
7473

7574
private static AiaOcspServiceConfiguration getAiaOcspServiceConfiguration() throws JceException {
7675
return new AiaOcspServiceConfiguration(
77-
newHashSet(AIA_ESTEID_2015, TEST_ESTEID_2015),
76+
newHashSet(TEST_ESTEID_2015),
7877
CertificateValidator.buildTrustAnchorsFromCertificates(TRUSTED_CA_CERTIFICATES),
7978
CertificateValidator.buildCertStoreFromCertificates(TRUSTED_CA_CERTIFICATES));
8079
}

0 commit comments

Comments
 (0)