error during signers.sign_pdf #60
-
Hello All
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
This is very interesting. For some reason, either the OCSP responder's certificate or the issuer certificate can't be fully decoded (or encoded) by Would it be possible to send the affected certificates (without the private key material, obviously) to pyhanko.samples@mvalvekens.be so I can investigate? If you're consistently getting this error with a certain If you're not at liberty to disclose the certificates, I certainly understand, but then this issue is going to be tricky for me to diagnose accurately. In case you're familiar with X.509 and can read ASN.1, putting the certificates through an ASN.1 decoder could also be useful. :) EDIT: While I don't maintain If you're not familiar with ASN.1, I can try to walk you through the process I would use to figure out whether the issue is related to |
Beta Was this translation helpful? Give feedback.
-
Alright, with some staring at the files that were sent to me (thanks, @inui-sdt2!), I figured out the root cause(s) of the problem. TL;DR: There's no problem with your certificates. It's FreeTSA's OCSP responder that is broken. I'll look into hardening Here's an alternative option: If you want the full explanation, read on. There are actually two different phenomena at play. First, the OCSP responder operated by FreeTSA indeed includes a malformed certificate in its responses (see attachment). The certificate policies extension on the certificate "identifies" its certification policy using an OID of length zero. This is not allowed in ASN.1, and leads to a parse error in Now, of course this does not explain why this error only crops up occasionally, and not on every single signature with a timestamp... The reason for that is actually that FreeTSA's OCSP responder is offline for the vast majority of the time! Since But it gets better: after a couple tries, I noticed that I was usually able to get in one OCSP request right at the hour mark. I suspect that FreeTSA's OCSP responder is scheduled to restart at the top of every hour, and that it simply crashes after the first request, which causes it to go down again until another hour goes by. All things considered, this was a pretty interesting bug hunt! |
Beta Was this translation helpful? Give feedback.
Alright, with some staring at the files that were sent to me (thanks, @inui-sdt2!), I figured out the root cause(s) of the problem.
TL;DR: There's no problem with your certificates. It's FreeTSA's OCSP responder that is broken. I'll look into hardening
pyhanko-certvalidator
to treat cases like this as it would any other OCSP fetching error. In the meantime, switching to a different TSA should suffice.Here's an alternative option:
http://timestamp.entrust.net/TSS/RFC3161sha2TS
, operated by Entrust. Unlike FreeTSA, this one is on the AATL, so it can even be used in (most) production workflows.If you want the full explanation, read on.
There are actually two different phenomena at play. F…