Ignore X.509 validations #84
-
Hi everyone! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi there! That depends. The error comes from this bit of logic used in This is not an X.509 validation error, but has to do with an encoding error in the certificate or in the signature's So, is it possible to suppress this error? Maybe. That depends on where it enters pyHanko's processing---I'll need a complete stack trace to judge that. That said, it's quite likely that pyHanko is hitting this error while trying to locate the signer's certificate, not when trying to validate it. If that's the problem, then there's probably no easy way to solve your issue: failure to match a certificate ID => no signer certificate found => no relevant public key available to validate the signature with. If you could supply the signed file as well, that'd be even better (see here for instructions if you're not comfortable sharing those in public). TL;DR: This is almost certainly an encoding issue in one of the certificates bundled with the signature, or in the signature's EDIT: after some back-and-forth over email: So, the good news is that I found the issue after investigating your files, but the bad news is that it's not going to be easy to work around.
All things considered, it's pretty much impossible to work around data errors of this type as a user of pyHanko. That said, I do have one Note: I recently did just that in commit 86400c3. |
Beta Was this translation helpful? Give feedback.
Hi there!
That depends. The error comes from this bit of logic used in
asn1crypto
's implementation of__eq__
for name objects: https://github.com/wbond/asn1crypto/blob/8b6e8035b0805828d35656c38d4dca5d6a145075/asn1crypto/x509.py#L817-L837.This is not an X.509 validation error, but has to do with an encoding error in the certificate or in the signature's
SignerInfo
---or it's a bug inasn1crypto
. One of theName
objects in the signature data contains a piece of Unicode text that has a malformed bidi sequence (according toasn1crypto
), which causes problems when trying to compare names somewhere.So, is it possible to suppress this error? Maybe. That depends on where it enters pyHanko's proc…