signify icon indicating copy to clipboard operation
signify copied to clipboard

Different ContentType

Open qux-bbb opened this issue 5 years ago • 1 comments

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

qux-bbb avatar Jan 06 '20 15:01 qux-bbb

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 avatar Jan 19 '20 17:01 ralphje