CMSSigner signedData content support Microsoft Authenticode? #26
Replies: 2 comments 3 replies
-
The CMSSigner likely does not have all the required configuration options to fulfill what is needed for Authenticode. To sign various file formats like MSI, PE, PS1 etc., using Authenticode there is the MSAuthCode signers but those are currently only in Enterprise Edition. Sure you can set the CONTENTOID in the CMSSigner but there are likely also other things needed like certain Authenticode specific signed attributes. Let's say the CMSSigner would have everything needed for Authenticode, for what and how do you plan to use it? I mean it would only create the signature and if you for instance would sign an EXE file you would need something to calculate what should be signed and format the content and then in the end include that signature into the binary, no? Cheers, |
Beta Was this translation helpful? Give feedback.
-
The code looks alright at a first glance at least. The CMSSigner would encapsulate exactly what you provide as input. But for an Authenticode signature the content should be this special structure. The MSAuthCodeCMSSigner implements Authenticode signing and creates this structure but is currently only available in Enterprise so with the normal CMSSigner you would need to take care of constructing the structure first. |
Beta Was this translation helpful? Give feedback.
-
The CMS signer can sign arbitrary data and produces a CMS (RFC 3852) SignedData structure in binary format.
The following is the configuration of the worker.
I get the cms.sign, and use the following command to parse the signature file
openssl pkcs7 -inform der -in cms.sig -print
The analysis results are as follows (only the relevant part of the question is intercepted)
Now I want the signedData content of CMSSigner to be the mode defined by Microsoft Authenticode, how should I do it? I've tried configuring
CONTENTOID 1.3.6.1.4.1.311.2.1.4
for the worker, but it not ok.Beta Was this translation helpful? Give feedback.
All reactions