Skip to content
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

Different ContentType #5

Open
qux-bbb opened this issue Jan 6, 2020 · 1 comment
Open

Different ContentType #5

qux-bbb opened this issue Jan 6, 2020 · 1 comment
Labels
research Requires additional research

Comments

@qux-bbb
Copy link

qux-bbb commented Jan 6, 2020

When I verify a certificate of PE file. Some thing is wrong.
The Error is:
Unexpected content type for SignerInfo, expected 1.2.840.113549.1.9.16.1.4, got Data

The refer code in signerinfo.py:90 :

if self._expected_content_type is not None and self.content_type is not self._expected_content_type:
    raise SignerInfoParseError("Unexpected content type for SignerInfo, expected %s, got %s" %
                                (_print_type(self.content_type),
                                    _print_type(self._expected_content_type)))

The position of self.content_type and self._expected_content_type is mistaken, but that is not key point.

The key point is content type for SignerInfo maybe have different value.

You can see here: http://oidref.com/1.2.840.113549.1.9.16.1.4, the Information by oid_info is:

This is one of the possible values for the contentType value in the ContentInfo structure defined in PKCS#7 (IETF RFC 2630). See also IETF RFC 3161.

Maybe you can add another content type.

Oh, here is the PE file
3a7de393a36ca8911cd0842a9a25b058.zip

@ralphje
Copy link
Owner

ralphje commented Jan 19, 2020

This is implemented as per http://msdn.microsoft.com/en-us/library/windows/hardware/gg463180.aspx, though it seems that this is not exactly enforced. While I'd need to look into this, it doesn't seem to harm to change this to a more relaxed policy.

@ralphje ralphje added question Further information is requested research Requires additional research and removed question Further information is requested labels Oct 11, 2020
@ralphje ralphje closed this as completed in ddd32e3 Jun 8, 2024
@ralphje ralphje reopened this Jun 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
research Requires additional research
Projects
None yet
Development

No branches or pull requests

2 participants