Giter VIP home page Giter VIP logo

web-eid-authtoken-validation-java's People

Contributors

counter178 avatar dependabot[bot] avatar kristelmerilain avatar metsma avatar mrts avatar zutnop avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

web-eid-authtoken-validation-java's Issues

OCSP update time validation seems incorrect

From the description, it seems that thisUpdate and nextUpdate should be checked agaisnt system local time, but the code checks it againts producetAt value from OCSP response, so no matter the system time, response is always valid:

public static void validateCertificateStatusUpdateTime(SingleResp certStatusResponse, Date producedAt) throws UserCertificateOCSPCheckFailedException {
// From RFC 2560, https://www.ietf.org/rfc/rfc2560.txt:
// 4.2.2. Notes on OCSP Responses
// 4.2.2.1. Time
// Responses whose nextUpdate value is earlier than
// the local system time value SHOULD be considered unreliable.
// Responses whose thisUpdate time is later than the local system time
// SHOULD be considered unreliable.
// If nextUpdate is not set, the responder is indicating that newer
// revocation information is available all the time.
final Date notAllowedBefore = new Date(producedAt.getTime() - ALLOWED_TIME_SKEW);
final Date notAllowedAfter = new Date(producedAt.getTime() + ALLOWED_TIME_SKEW);
final Date thisUpdate = certStatusResponse.getThisUpdate();
final Date nextUpdate = certStatusResponse.getNextUpdate() != null ? certStatusResponse.getNextUpdate() : thisUpdate;
if (notAllowedAfter.before(thisUpdate) ||
notAllowedBefore.after(nextUpdate)) {
throw new UserCertificateOCSPCheckFailedException("Certificate status update time check failed: " +
"notAllowedBefore: " + toUtcString(notAllowedBefore) +
", notAllowedAfter: " + toUtcString(notAllowedAfter) +
", thisUpdate: " + toUtcString(thisUpdate) +
", nextUpdate: " + toUtcString(certStatusResponse.getNextUpdate()));
}
}

What certificates are needed in trusted certificates list?

Documentation #4. Add trusted certificate authority certificates (https://github.com/web-eid/web-eid-authtoken-validation-java#4-add-trusted-certificate-authority-certificates) mentions that "You must explicitly specify which intermediate certificate authorities (CAs) are trusted..". Assuming this is talking about certificates issued by SK (https://www.skidsolutions.eu) I went to look up their certificate list at https://www.skidsolutions.eu/resources/certificates/ for certificates marked as "intermediate" - but I found none. This raises question - exactly what certificates are needed in this trusted certificates list?
I guess that ones on the "Issuing-CAs" tab are needed. But can't be sure. And its difficult to find out for sure by testing.
Is it possible to add concrete list of required certificates to documentation?
Naturally this is going to change in the future but its not an impossible task to keep it updated.

Add user certificate policy validation

  • Add configuration option for disallowed user certificate policies
  • Add user certificate policy validator that checks policies against disallowed policies

Refs WE2-332

Version 3 requires Java 11

Using a newer LTS version of Java enables us to use the built-in HttpClient and discard the OkHttpClient dependency as requested in #31.

Version 3 was released on August 7, 2023. As originally announced, we guarantee Java 8 compatible maintenance releases of version 2 until September 2023 and beyond if necessary.

If you need Java 8 support after September 2023, please request it in issue comments below.

Allow multiple responder certificates in OCSP response

Some OCSP servers (e.g. http://ocsp.eparaksts.lv) add multiple responder certificates in OCSP response. This causes auth token validation error:
User certificate revocation check has failed: OCSP response must contain one responder certificate, received 2 certificates instead
due to this check:
https://github.com/web-eid/web-eid-authtoken-validation-java/blob/main/src/main/java/eu/webeid/security/validator/certvalidators/SubjectCertificateNotRevokedValidator.java#L142-L145

Is it possible to modify the check so that if at least one responder certificate is valid, then whole response is valid?

Library crashes if there are expired Trusted CA certs configured

It could be a warning, but not a crash just because one day (today) we have an expired cert not removed from production.

"error": "java.security.cert.CertificateExpiredException: NotAfter: Mon Mar 18 00:00:00 EET 2024",
    "stack": [
      ".CertificateValidity.valid(Unknown Source)",
      "java.base/sun.security.x509.X509CertImpl.checkValidity(Unknown Source)",
      ".certificateIsValidOnDate(CertificateValidator.java:52)",
      "eu.webeid.security.certificate.CertificateValidator.trustedCACertificatesAreValidOnDate(CertificateValidator.java:62)",
      ".SubjectCertificateExpiryValidator.validateCertificateExpiry(SubjectCertificateExpiryValidator.java:56)",
      ".certvalidators.SubjectCertificateValidatorBatch.executeFor(SubjectCertificateValidatorBatch.java:44)",
      ".validateToken(AuthTokenValidatorImpl.java:161)",
      "eu.webeid.security.validator.AuthTokenValidatorImpl.validate(AuthTokenValidatorImpl.java:122)",
      "(WebEidClient.kt:29)",
...

The problem appeared today with expired KLASS3 2010 certs.

Publish source jar in Maven repository

https://gitlab.com/web-eid/service/web-eid-authtoken-validation-java/-/packages/10019924 doesn't seem to contain sources jar. Please publish sources jar (and possibly also javadoc jar) alongside the release artifact, it's a common practice (e.g. https://repo1.maven.org/maven2/org/springframework/spring-webmvc/5.3.23/). Then IDE-s could fetch it automatically and make browsing and debugging the source code easier, when authtoken-validation is used as a dependency in some project.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.