Skip to content

Commit

Permalink
Add support for SpcRelaxedPeMarkerCheck and PlatformManifestBinaryID …
Browse files Browse the repository at this point in the history
…CMS attributes
  • Loading branch information
ralphje committed Oct 19, 2024
1 parent 580ee92 commit e4b354e
Showing 1 changed file with 41 additions and 4 deletions.
45 changes: 41 additions & 4 deletions signify/asn1/spc.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
Sequence,
SequenceOf,
SetOf,
UTF8String,
)
from asn1crypto.x509 import Extension, ExtensionId

Expand Down Expand Up @@ -324,15 +325,51 @@ class SetOfSpcStatementType(SetOf): # type: ignore[misc]
_child_spec = SpcStatementType


class PlatformManifestBinaryID(UTF8String): # type: ignore[misc]
"""PlatformManifestBinaryID.
Present as OID 1.3.6.1.4.1.311.10.3.28, reversed as being a UTF8 string. The
purpose of this attribute is currently unknown.
"""


class SetOfPlatformManifestBinaryID(SetOf): # type: ignore[misc]
_child_spec = PlatformManifestBinaryID


class SpcRelaxedPeMarkerCheck(Integer): # type: ignore[misc]
"""SpcRelaxedPeMarkerCheck.
Present as OID 1.3.6.1.4.1.311.2.6.1, reversed as being an integer. The
purpose of this attribute is currently unknown.
"""


class SetOfSpcRelaxedPeMarkerCheck(SetOf): # type: ignore[misc]
_child_spec = SpcRelaxedPeMarkerCheck


ContentType._map["1.3.6.1.4.1.311.2.1.4"] = "microsoft_spc_indirect_data_content"
EncapsulatedContentInfo._oid_specs["microsoft_spc_indirect_data_content"] = (
ContentInfo._oid_specs["microsoft_spc_indirect_data_content"]
) = SpcIndirectDataContent

CMSAttributeType._map["1.3.6.1.4.1.311.2.1.11"] = "microsoft_spc_statement_type"
CMSAttributeType._map["1.3.6.1.4.1.311.2.1.12"] = "microsoft_spc_sp_opus_info"
CMSAttribute._oid_specs["microsoft_spc_sp_opus_info"] = SetOfSpcSpOpusInfo
CMSAttribute._oid_specs["microsoft_spc_statement_type"] = SetOfSpcStatementType
CMSAttributeType._map.update(
{
"1.3.6.1.4.1.311.2.1.11": "microsoft_spc_statement_type",
"1.3.6.1.4.1.311.2.1.12": "microsoft_spc_sp_opus_info",
"1.3.6.1.4.1.311.2.6.1": "microsoft_spc_relaxed_pe_marker_check",
"1.3.6.1.4.1.311.10.3.28": "microsoft_platform_manifest_binary_id",
}
)
CMSAttribute._oid_specs.update(
{
"microsoft_spc_sp_opus_info": SetOfSpcSpOpusInfo,
"microsoft_spc_statement_type": SetOfSpcStatementType,
"microsoft_spc_relaxed_pe_marker_check": SetOfSpcRelaxedPeMarkerCheck,
"microsoft_platform_manifest_binary_id": SetOfPlatformManifestBinaryID,
}
)


# reverse-engineered certificate extensions
Expand Down

0 comments on commit e4b354e

Please sign in to comment.