microsoft / microsoft/win32metadata
Add APPX_SIP_CLIENT_DATA, SIGNER_SIGN_EX2_PARAMS and SIGNER_SIGN_EX3_PARAMS for app package signing
- Dominant language
- C++
- Stars
- 1.5k
- Forks
- 149
- Avg merge
- 5d 16h
- Merged PRs (30d)
- 4
Description
`SignerSignEx2` and `SignerSignEx3` are in the metadata, but signing an app package (.appx/.msix and bundles) with them requires passing an `APPX_SIP_CLIENT_DATA` through `pSipData`, and that structure is missing, along with the `SIGNER_SIGN_EX2_PARAMS` / `SIGNER_SIGN_EX3_PARAMS` it points to. Projects using CsWin32 therefore still have to declare them by hand, for example [AzureSignTool](https://github.com/vcsjones/AzureSignTool), where `Interop/mssign32.cs` exists only for these types.
`APPX_SIP_CLIENT_DATA` and `SIGNER_SIGN_EX2_PARAMS` are described in [How to programmatically sign an app package](https://learn.microsoft.com/windows/win32/appxpkg/how-to-programmatically-sign-a-package). `SIGNER_SIGN_EX3_PARAMS` is the `SignerSignEx3` counterpart and does not appear to be documented. None of the three is declared in the Windows SDK headers (checked 10.0.19041.0 and 10.0.26100.0), which is presumably why the scraper never picked them up.
The layouts that work in practice against `mssign32.dll`:
```c
typedef struct _SIGNER_SIGN_EX2_PARAMS {
DWORD dwFlags;
PSIGNER_SUBJECT_INFO pSubjectInfo;
PSIGNER_CERT pSigningCert;
PSIGNER_SIGNATURE_INFO pSignatureInfo;
PSIGNER_PROVIDER_INFO pProviderInfo;
DWORD dwTimestampFlags;
PCSTR pszAlgorithmOid;
PCWSTR pwszTimestampURL;
PCRYPT_ATTRIBUTES pCryptAttrs;
PVOID pSipData;
PSIGNER_CONTEXT *pSignerContext;
PVOID pCryptoPolicy;
PVOID pReserved;
} SIGNER_SIGN_EX2_PARAMS, *PSIGNER_SIGN_EX2_PARAMS;
typedef struct _SIGNER_SIGN_EX3_PARAMS {
DWORD dwFlags;
PSIGNER_SUBJECT_INFO pSubjectInfo;
PSIGNER_CERT pSignerCert;
PSIGNER_SIGNATURE_INFO pSignatureInfo;
PSIGNER_PROVIDER_INFO pProviderInfo;
DWORD dwTimestampFlags;
PCSTR pszTimestampAlgorithmOid;
PCWSTR pwszHttpTimeStamp;
PCRYPT_ATTRIBUTES psRequest;
PSIGNER_DIGEST_SIGN_INFO pSignCallBack;
PSIGNER_CONTEXT *ppSignerContext;
PCERT_STRONG_SIGN_PARA pCryptoPolicy;
PVOID pReserved;
} SIGNER_SIGN_EX3_PARAMS, *PSIGNER_SIGN_EX3_PARAMS;
typedef struct _APPX_SIP_CLIENT_DATA {
PSIGNER_SIGN_EX2_PARAMS pSignerParams; // PSIGNER_SIGN_EX3_PARAMS when used with SignerSignEx3
IUnknown *pAppxSipState;
} APPX_SIP_CLIENT_DATA, *PAPPX_SIP_CLIENT_DATA;
```
It would also help if `SignerSignEx2` / `SignerSignEx3` annotated `pSipData` to point at `APPX_SIP_CLIENT_DATA` (or at least mentioned it), since nothing in the projection hints that app packages need it.
Contributor guide
Research direction
Locate the existing metadata declarations for SignerSignEx2 and SignerSignEx3, then use the layouts in the issue and AzureSignTool's Interop/mssign32.cs as references. Add APPX_SIP_CLIENT_DATA and both parameter structures, and update pSipData annotations or documentation so the generated projection exposes the app-package signing types.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, cpp
- Domain
- api, tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100