felleslosninger / efm-certvalidator Goto Github PK
View Code? Open in Web Editor NEWCertificate validator for X.509 certificates.
License: Other
Certificate validator for X.509 certificates.
License: Other
A NullPointerException might occur in CRLRule, as the stacktrace below shows. As far as I can see this happens when the rule encounters an X.509 CRL which does not have the Next update field. I'm unfortunately not able to provide information about which issuer that returned this CRL. However, I think the rule could handle this scenario better, either by issuing a new fetch, use the current CRL for validation, or fail the validation.
java.lang.NullPointerException: null
at no.difi.certvalidator.rule.CRLRule.validate(CRLRule.java:50) ~[commons-certvalidator-2.0.1.jar:na]
at no.difi.certvalidator.structure.AndJunction.validate(AndJunction.java:23) ~[commons-certvalidator-2.0.1.jar:na]
at no.difi.certvalidator.Validator.validate(Validator.java:49) ~[commons-certvalidator-2.0.1.jar:na]
at no.difi.common.support.CertificateValidatorInterceptor.validateMessage(CertificateValidatorInterceptor.java:47) ~[CertificateValidatorInterceptor.class:na]
We tried to upgrade our bouncycastle dependencies to version 1.66, but we get a ClassCastException with the following stacktrace:
no.difi.vefa.peppol.security.lang.PeppolSecurityException: Exception when reading AIA: 'org.bouncycastle.asn1.DLTaggedObject cannot be cast to org.bouncycastle.asn1.DERTaggedObject'.
at no.difi.vefa.peppol.security.util.DifiCertificateValidator.validate(DifiCertificateValidator.java:64)
at no.difi.vefa.peppol.lookup.LookupClient.getServiceMetadata(LookupClient.java:95)
...internal stack trace here....
Caused by: no.difi.certvalidator.api.FailedValidationException: Exception when reading AIA: 'org.bouncycastle.asn1.DLTaggedObject cannot be cast to org.bouncycastle.asn1.DERTaggedObject'.
at no.difi.certvalidator.rule.OCSPRule.validate(OCSPRule.java:41)
at no.difi.certvalidator.rule.AbstractRule.validate(AbstractRule.java:24)
at no.difi.certvalidator.rule.HandleErrorRule.validate(HandleErrorRule.java:44)
at no.difi.certvalidator.rule.AbstractRule.validate(AbstractRule.java:17)
at no.difi.certvalidator.structure.AndJunction.validate(AndJunction.java:29)
at no.difi.certvalidator.structure.AbstractJunction.validate(AbstractJunction.java:36)
at no.difi.certvalidator.util.CachedValidatorRule.load(CachedValidatorRule.java:43)
at no.difi.certvalidator.util.CachedValidatorRule.load(CachedValidatorRule.java:13)
at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3528)
at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2277)
at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2154)
at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2044)
at com.google.common.cache.LocalCache.get(LocalCache.java:3952)
at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3974)
at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4958)
at com.google.common.cache.LocalCache$LocalLoadingCache.getUnchecked(LocalCache.java:4964)
at no.difi.certvalidator.util.CachedValidatorRule.validate(CachedValidatorRule.java:30)
at no.difi.certvalidator.util.CachedValidatorRule.validate(CachedValidatorRule.java:35)
at no.difi.certvalidator.structure.AndJunction.validate(AndJunction.java:29)
at no.difi.certvalidator.structure.AndJunction.validate(AndJunction.java:29)
at no.difi.certvalidator.structure.AbstractJunction.validate(AbstractJunction.java:36)
at no.difi.certvalidator.util.CachedValidatorRule.load(CachedValidatorRule.java:43)
at no.difi.certvalidator.util.CachedValidatorRule.load(CachedValidatorRule.java:13)
at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3528)
at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2277)
at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2154)
at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2044)
at com.google.common.cache.LocalCache.get(LocalCache.java:3952)
at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3974)
at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4958)
at com.google.common.cache.LocalCache$LocalLoadingCache.getUnchecked(LocalCache.java:4964)
at no.difi.certvalidator.util.CachedValidatorRule.validate(CachedValidatorRule.java:30)
at no.difi.certvalidator.util.CachedValidatorRule.validate(CachedValidatorRule.java:35)
at no.difi.certvalidator.ValidatorGroup.validate(ValidatorGroup.java:79)
at no.difi.certvalidator.ValidatorGroup.validate(ValidatorGroup.java:70)
at no.difi.vefa.peppol.security.util.DifiCertificateValidator.validate(DifiCertificateValidator.java:62)
... 48 more
Caused by: net.klakegg.pkix.ocsp.OcspException: Exception when reading AIA: 'org.bouncycastle.asn1.DLTaggedObject cannot be cast to org.bouncycastle.asn1.DERTaggedObject'.
at net.klakegg.pkix.ocsp.AbstractOcspClient.detectOcspUri(AbstractOcspClient.java:99)
at net.klakegg.pkix.ocsp.OcspClient.verify(OcspClient.java:51)
at net.klakegg.pkix.ocsp.OcspClient.verify(OcspClient.java:44)
at no.difi.certvalidator.rule.OCSPRule.validate(OCSPRule.java:34)
... 83 more
Caused by: java.lang.ClassCastException: org.bouncycastle.asn1.DLTaggedObject cannot be cast to org.bouncycastle.asn1.DERTaggedObject
at net.klakegg.pkix.ocsp.AbstractOcspClient.detectOcspUri(AbstractOcspClient.java:91)
... 86 more
It seems similar to this issue for digipost's certificate validator digipost/certificate-validator#15
Hi great library you have built. Had just couple of questions if you could answer.
(1) Is the validator costly to instantiate?
(2) How would one approach if wanting to dynamically update the root & intermediate buckets used by the validator?
Also I noticed that the README should update with the latest version 2.2.0
BR
Hi
A lot thanks for the library, I have a question.
The example of the OCSP rule don't work, asks for a parameter, for a certificate bucket.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.