-
-
Notifications
You must be signed in to change notification settings - Fork 140
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error parsing ParsableOctetString while parsing EncapsulatedContentInfo (test case) #283
Comments
这是来自QQ邮箱的假期自动回复邮件。你好,我最近正在休假中,无法亲自回复你的邮件。我将在假期结束后,尽快给你回复。
|
You need to use |
Thanks! However this test case was part of a bigger issue, this one: from asn1crypto.cms import ContentInfo
import asn1crypto.tsp # extends ContentInfo
INPUT_FILE = 'problematic.xml.p7m.tsd'
cnt = ContentInfo.load(open(INPUT_FILE, 'rb').read(), strict=True)
cnt.native Error:
"problematic.xml.p7m.tsd" is a PKCS#7 with a timestamp applied. Am I doing something wrong again? ;-) If not I'll open another issue with "problematic.xml.p7m.tsd" attached. |
I don't know if you're doing something wrong. If you could generate a minimal example (i.e. not a full PKCS#7 file) it would help a lot. |
I managed to reproduce the problem with just the timestamp part applied to a simple TXT file. I have:
I don't know how to get more minimal than this ;-)
results in
I'm attaching everything here, but maybe I should open another issue? |
This might be a bug in asn1crypto. diff --git a/asn1crypto/tsp.py b/asn1crypto/tsp.py
index f006da9..ead07cc 100644
--- a/asn1crypto/tsp.py
+++ b/asn1crypto/tsp.py
@@ -171,7 +171,7 @@ class MetaData(Sequence):
class TimeStampAndCRL(Sequence):
_fields = [
- ('time_stamp', EncapsulatedContentInfo),
+ ('time_stamp', ContentInfo),
('crl', CertificateList, {'optional': True}),
] @wbond Do you remember why this is an RFC5544 defines:
And RFC3161 defines:
|
Hello,
I have troubles parsing a "timestamp".. I don't have access to the code that produced it.
Code to reproduce the issue:
enc_content_info2.dat.zip
Error with last git version b763a75 (it's the same with v1.5.1):
Side note, openssl asn1parse works:
The text was updated successfully, but these errors were encountered: