20 #include "wine/port.h" 23 #define NONAMELESSUNION 47 DWORD dwCtrlType,
const void *pvCtrlPara);
50 DWORD dwCtrlType,
const void *pvCtrlPara)
52 TRACE(
"(%p, %08x, %d, %p)\n", hCryptMsg,
dwFlags, dwCtrlType, pvCtrlPara);
87 msg->stream_info = *pStreamInfo;
95 msg->get_param = get_param;
97 msg->control = control;
153 if (
msg->base.streamed &&
msg->base.stream_info.cbContent == 0xffffffff)
155 static const BYTE headerValue[] = { 0x30,0x80,0x06,0x09,0x2a,0x86,0x48,
156 0x86,0xf7,0x0d,0x01,0x07,0x01,0xa0,0x80,0x24,0x80 };
161 header->cbData =
sizeof(headerValue);
162 memcpy(
header->pbData, headerValue,
sizeof(headerValue));
185 header->cbData -=
msg->base.stream_info.cbContent;
199 else if (
msg->base.streamed)
210 ret =
msg->base.stream_info.pfnStreamOutput(
219 if (
msg->base.stream_info.cbContent == 0xffffffff)
229 ret =
msg->base.stream_info.pfnStreamOutput(
230 msg->base.stream_info.pvArg,
header, headerLen,
237 ret =
msg->base.stream_info.pfnStreamOutput(
245 if (
msg->base.stream_info.cbContent == 0xffffffff)
247 BYTE indefinite_trailer[6] = { 0 };
249 ret =
msg->base.stream_info.pfnStreamOutput(
253 ret =
msg->base.stream_info.pfnStreamOutput(
254 msg->base.stream_info.pvArg, indefinite_trailer,
255 sizeof(indefinite_trailer),
TRUE);
258 ret =
msg->base.stream_info.pfnStreamOutput(
288 &
msg->bare_content_len);
324 if (
msg->base.streamed)
329 char rsa_data[] =
"1.2.840.113549.1.7.1";
331 info.pszObjId = rsa_data;
332 info.Content.cbData =
msg->bare_content_len;
333 info.Content.pbData =
msg->bare_content;
339 if (
msg->base.streamed)
343 msg->bare_content_len);
445 TRACE(
"(%p, %d, %d, %p, %p)\n", hCryptMsg, dwParamType, dwIndex,
451 if (
msg->base.streamed)
461 &
info.Content.cbData);
465 if (
info.Content.pbData)
468 info.Content.pbData, &
info.Content.cbData);
473 info.pszObjId = oid_rsa_hashed;
512 TRACE(
"(%p, %p, %d, %d)\n", hCryptMsg,
pbData, cbData, fFinal);
534 if (
msg->data.pbData)
537 msg->data.cbData += cbData;
566 if (
info->hCryptProv)
567 prov =
info->hCryptProv;
585 msg->data.cbData = 0;
687 FIXME(
"CMSG_SIGNER_ENCODE_INFO with CMS fields unsupported\n");
708 out->cbData =
in->cbData;
736 for (
i = 0;
ret &&
i < cBlobs;
i++)
749 for (
i = 0;
i < cBlobs;
i++)
764 in->cValue,
in->rgValue);
776 out->cAttr =
in->cAttr;
806 &
in->pCertInfo->Issuer);
809 &
info->SignerId.u.IssuerSerialNumber.SerialNumber,
810 &
in->pCertInfo->SerialNumber);
812 info->HashEncryptionAlgorithm.pszObjId =
813 in->pCertInfo->SubjectPublicKeyInfo.Algorithm.pszObjId;
816 &
in->pCertInfo->SubjectPublicKeyInfo.Algorithm.Parameters);
825 if (!
in->SignerId.dwIdChoice)
829 &
in->pCertInfo->Issuer);
832 &
info->SignerId.u.IssuerSerialNumber.SerialNumber,
833 &
in->pCertInfo->SerialNumber);
841 &
in->SignerId.u.IssuerSerialNumber.Issuer);
844 &
info->SignerId.u.IssuerSerialNumber.SerialNumber,
845 &
in->SignerId.u.IssuerSerialNumber.SerialNumber);
853 &
in->SignerId.u.KeyId);
855 pEncrAlg =
in->HashEncryptionAlgorithm.
pszObjId ?
856 &
in->HashEncryptionAlgorithm :
857 &
in->pCertInfo->SubjectPublicKeyInfo.Algorithm;
858 info->HashEncryptionAlgorithm.pszObjId = pEncrAlg->
pszObjId;
866 info->HashAlgorithm.pszObjId =
in->HashAlgorithm.pszObjId;
869 &
in->HashAlgorithm.Parameters);
893 for (
i = 0;
i <
info->AuthAttrs.cAttr;
i++)
895 for (
j = 0;
j <
info->AuthAttrs.rgAttr[
i].cValue;
j++)
901 for (
i = 0;
i <
info->UnauthAttrs.cAttr;
i++)
903 for (
j = 0;
j <
info->UnauthAttrs.rgAttr[
i].cValue;
j++)
1034 CRYPT_ATTRIBUTE messageDigestAttr = { messageDigest, 1, &encodedHash };
1049 NULL, (
LPBYTE)&encodedHash.pbData, &encodedHash.cbData);
1054 &messageDigestAttr);
1074 TRACE(
"(%p)\n", msg_data);
1082 BYTE oid_rsa_data_encoded[] = { 0x06,0x09,0x2a,0x86,0x48,0x86,
1083 0xf7,0x0d,0x01,0x07,0x01 };
1085 oid_rsa_data_encoded };
1123 for (
i = 0;
i <
hash->cbData / 2;
i++)
1125 tmp =
hash->pbData[
hash->cbData -
i - 1];
1127 hash->pbData[
i] = tmp;
1136 TRACE(
"(%p)\n", msg_data);
1202 msg->msg_data.info->rgCertEncoded);
1204 msg->msg_data.info->rgCrlEncoded);
1205 for (
i = 0;
i <
msg->msg_data.info->cSignerInfo;
i++)
1219 switch (dwParamType)
1226 &
info.Content.cbData);
1230 if (
info.Content.pbData)
1233 info.Content.pbData, &
info.Content.cbData);
1238 info.pszObjId = oid_rsa_signed;
1261 info.content.pszObjId = oid_rsa_data;
1264 if (
msg->data.cbData)
1270 &
info.content.Content.pbData, &
info.content.Content.cbData);
1275 info.content.Content.cbData = 0;
1276 info.content.Content.pbData =
NULL;
1282 info.content.pszObjId =
msg->innerOID;
1283 info.content.Content.cbData =
msg->data.cbData;
1284 info.content.Content.pbData =
msg->data.pbData;
1296 if (dwIndex >=
msg->msg_data.cSignerHandle)
1300 msg->msg_data.signerHandles[dwIndex].contentHash,
HP_HASHVAL,
1304 if (dwIndex >=
msg->msg_data.info->cSignerInfo)
1313 sizeof(
msg->msg_data.info->version));
1333 if (
msg->base.streamed)
1334 FIXME(
"streamed partial stub\n");
1346 if (
msg->data.pbData)
1349 msg->data.cbData = cbData;
1365 const void *pvMsgEncodeInfo,
LPCSTR pszInnerContentObjID,
1379 info->cAttrCertEncoded)
1381 FIXME(
"CMSG_SIGNED_ENCODE_INFO with CMS fields unsupported\n");
1384 for (
i = 0;
i <
info->cSigners;
i++)
1395 if (pszInnerContentObjID)
1399 strcpy(
msg->innerOID, pszInnerContentObjID);
1405 msg->data.cbData = 0;
1411 if (
msg->msg_data.info)
1422 msg->msg_data.info->rgSignerInfo =
1424 if (
msg->msg_data.info->rgSignerInfo)
1426 msg->msg_data.info->cSignerInfo =
info->cSigners;
1427 memset(
msg->msg_data.info->rgSignerInfo, 0,
1428 msg->msg_data.info->cSignerInfo *
1432 if (!
msg->msg_data.info->signerKeySpec)
1434 for (
i = 0;
ret &&
i <
msg->msg_data.info->cSignerInfo;
i++)
1436 if (
info->rgSigners[
i].SignerId.dwIdChoice ==
1440 &
msg->msg_data.info->rgSignerInfo[
i],
1441 &
info->rgSigners[
i]);
1450 msg->msg_data.info->signerKeySpec[
i] =
1451 info->rgSigners[
i].dwKeySpec;
1459 msg->msg_data.info->cSignerInfo = 0;
1460 msg->msg_data.signerHandles =
NULL;
1461 msg->msg_data.cSignerHandle = 0;
1466 &
msg->msg_data.info->rgCertEncoded,
info->cCertEncoded,
1467 info->rgCertEncoded);
1470 &
msg->msg_data.info->rgCrlEncoded,
info->cCrlEncoded,
1471 info->rgCrlEncoded);
1527 out->cbData =
in->cbData;
1528 out->cUnusedBits =
in->cUnusedBits;
1552 info->ContentEncryptionAlgorithm.pszObjId, 0, (
void **)&genKeyFunc, &hFunc);
1560 &
info->hContentEncryptKey);
1636 info->rgCmsRecipients[
i].u.pKeyTrans;
1640 memset(&encryptInfo, 0,
sizeof(encryptInfo));
1641 encryptInfo.
cbSize =
sizeof(encryptInfo);
1655 ret = exportKeyFunc(
info, encodeInfo, &encryptInfo, 0,
NULL);
1687 info->hCryptProv = prov;
1689 &
in->ContentEncryptionAlgorithm);
1690 info->pvEncryptionAuxInfo =
in->pvEncryptionAuxInfo;
1691 info->cRecipients =
in->cRecipients;
1696 if (
info->rgCmsRecipients)
1700 for (
i = 0;
ret &&
i <
in->cRecipients; ++
i)
1705 info->rgCmsRecipients[
i].dwRecipientChoice =
1708 info->rgCmsRecipients[
i].u.pKeyTrans = encodeInfo;
1711 encodeInfo->
cbSize =
sizeof(*encodeInfo);
1714 &
cert->SubjectPublicKeyInfo.Algorithm);
1720 &
cert->SubjectPublicKeyInfo.PublicKey);
1728 &
cert->SerialNumber);
1746 if (
info->rgCmsRecipients)
1750 for (
i = 0;
i <
info->cRecipients; ++
i)
1753 info->rgCmsRecipients[
i].u.pKeyTrans;
1779 &
info->RecipientId.u.IssuerSerialNumber.SerialNumber,
1780 &
cert->SerialNumber);
1783 &
cert->SubjectPublicKeyInfo.Algorithm);
1784 info->EncryptedKey.cbData =
key->cbData;
1785 info->EncryptedKey.pbData =
key->pbData;
1807 if (
msg->recipientInfo)
1811 for (
i = 0;
i <
msg->cRecipientInfo; ++
i)
1824 switch (dwParamType)
1827 if (
msg->base.streamed)
1834 msg->recipientInfo, { oid_rsa_data, {
1836 {
msg->algo.Parameters.cbData,
msg->algo.Parameters.pbData }
1838 {
msg->data.cbData,
msg->data.pbData }
1851 &
info.Content.cbData);
1855 if (
info.Content.pbData)
1858 info.Content.pbData, &
info.Content.cbData);
1863 info.pszObjId = oid_rsa_enveloped;
1888 else if (
msg->base.streamed)
1890 FIXME(
"streamed stub\n");
1907 DWORD dataLen = cbData;
1909 msg->data.cbData = cbData;
1911 if (
msg->data.pbData)
1915 &dataLen,
msg->data.cbData);
1916 msg->data.cbData = dataLen;
1917 if (dataLen > cbData)
1921 if (
msg->data.pbData)
1925 msg->data.pbData, &dataLen,
msg->data.cbData);
1937 msg->data.cbData = 0;
1950 const void *pvMsgEncodeInfo,
LPCSTR pszInnerContentObjID,
1965 FIXME(
"CMS fields unsupported\n");
1971 if (
info->cRecipients && !
info->rgpRecipientCert)
1976 if (
info->hCryptProv)
1977 prov =
info->hCryptProv;
1995 &
info->ContentEncryptionAlgorithm);
1997 msg->data.cbData = 0;
1999 msg->cRecipientInfo =
info->cRecipients;
2002 if (!
msg->recipientInfo)
2004 memset(&encryptInfo, 0,
sizeof(encryptInfo));
2015 for (
i = 0;
ret &&
i <
msg->cRecipientInfo; ++
i)
2020 info->rgpRecipientCert[
i], &encryptedKey);
2035 DWORD dwMsgType,
const void *pvMsgEncodeInfo,
LPSTR pszInnerContentObjID,
2040 TRACE(
"(%08x, %08x, %08x, %p, %s, %p)\n", dwMsgEncodingType,
dwFlags,
2041 dwMsgType, pvMsgEncodeInfo,
debugstr_a(pszInnerContentObjID), pStreamInfo);
2052 pszInnerContentObjID, pStreamInfo);
2056 pszInnerContentObjID, pStreamInfo);
2060 pszInnerContentObjID, pStreamInfo);
2064 pszInnerContentObjID, pStreamInfo);
2111 if (
msg->u.enveloped_data.crypt_prov)
2117 if (
msg->u.signed_data.info)
2138 blob->cbData + cbData);
2144 blob->cbData += cbData;
2178 len +=
id->Parameters.cbData;
2188 if (
id->Parameters.cbData ==
sizeof(nullParams) &&
2189 !
memcmp(
id->Parameters.pbData, nullParams,
sizeof(nullParams)))
2191 copy->Parameters.cbData = 0;
2192 len -=
sizeof(nullParams);
2195 copy->Parameters.cbData =
id->Parameters.cbData;
2196 if (
copy->Parameters.cbData)
2198 id->Parameters.cbData);
2208 id->Parameters.pbData = (
BYTE *)
id->pszObjId +
strlen(
id->pszObjId) + 1;
2259 msg->u.enveloped_data.data = envelopedData;
2274 msg->u.signed_data.info = signedInfo;
2354 if (!
msg->crypt_prov)
2357 if (
msg->crypt_prov)
2393 &
msg->u.enveloped_data.data->encryptedContentInfo.encryptedContent;
2405 for (
i = 0;
ret &&
i <
msg->u.signed_data.info->cSignerInfo;
i++)
2407 &
msg->crypt_prov, &
msg->base.open_flags);
2420 content = &
msg->u.signed_data.info->content.Content;
2427 !
strcmp(
msg->u.signed_data.info->content.pszObjId,
2477 TRACE(
"(%p, %p, %d, %d)\n", hCryptMsg,
pbData, cbData, fFinal);
2481 else if (
msg->base.streamed)
2483 FIXME(
"(%p, %p, %d, %d): streamed update stub\n", hCryptMsg,
pbData,
2485 switch (
msg->base.state)
2525 switch (
msg->base.state)
2543 if (
ret && fFinal &&
2559 switch (dwParamType)
2605 out->cbData =
in->cbData;
2608 out->pbData = *nextData;
2610 *nextData +=
in->cbData;
2629 out->cAttr =
in->cAttr;
2637 for (
i = 0;
i <
in->cAttr;
i++)
2639 if (
in->rgAttr[
i].pszObjId)
2641 out->rgAttr[
i].pszObjId = (
LPSTR)*nextData;
2643 *nextData +=
strlen(
in->rgAttr[
i].pszObjId) + 1;
2645 if (
in->rgAttr[
i].cValue)
2649 out->rgAttr[
i].cValue =
in->rgAttr[
i].cValue;
2653 for (
j = 0;
j <
in->rgAttr[
i].cValue;
j++)
2655 &
in->rgAttr[
i].rgValue[
j], nextData);
2665 for (
i = 0;
i <
attr->cAttr;
i++)
2667 if (
attr->rgAttr[
i].pszObjId)
2672 for (
j = 0;
j <
attr->rgAttr[
i].cValue;
j++)
2688 attr.pszObjId = oid_key_rdn;
2713 issuer->pbData = *nextData;
2714 attr.pszObjId = oid_key_rdn;
2722 *nextData += encodedLen;
2723 issuer->cbData = encodedLen;
2738 size +=
in->SignerId.u.IssuerSerialNumber.Issuer.cbData;
2739 size +=
in->SignerId.u.IssuerSerialNumber.SerialNumber.cbData;
2746 if (
in->HashAlgorithm.pszObjId)
2748 size +=
in->HashAlgorithm.Parameters.cbData;
2749 if (
in->HashEncryptionAlgorithm.pszObjId)
2750 size +=
strlen(
in->HashEncryptionAlgorithm.pszObjId) + 1;
2751 size +=
in->HashEncryptionAlgorithm.Parameters.cbData;
2752 size +=
in->EncryptedHash.cbData;
2772 out->dwVersion =
in->dwVersion;
2776 &
in->SignerId.u.IssuerSerialNumber.Issuer, &nextData);
2778 &
in->SignerId.u.IssuerSerialNumber.SerialNumber, &nextData);
2782 &
in->SignerId.u.KeyId, rdnSize, &nextData);
2788 &
in->HashEncryptionAlgorithm, &nextData);
2810 size +=
in->SignerId.u.IssuerSerialNumber.Issuer.cbData;
2811 size +=
in->SignerId.u.IssuerSerialNumber.SerialNumber.cbData;
2814 size +=
in->SignerId.u.KeyId.cbData;
2815 if (
in->HashAlgorithm.pszObjId)
2817 size +=
in->HashAlgorithm.Parameters.cbData;
2818 if (
in->HashEncryptionAlgorithm.pszObjId)
2819 size +=
strlen(
in->HashEncryptionAlgorithm.pszObjId) + 1;
2820 size +=
in->HashEncryptionAlgorithm.Parameters.cbData;
2821 size +=
in->EncryptedHash.cbData;
2842 out->dwVersion =
in->dwVersion;
2843 out->SignerId.dwIdChoice =
in->SignerId.dwIdChoice;
2847 &
in->SignerId.u.IssuerSerialNumber.Issuer, &nextData);
2849 &
in->SignerId.u.IssuerSerialNumber.SerialNumber, &nextData);
2856 &
in->HashEncryptionAlgorithm, &nextData);
2877 size +=
in->SignerId.u.IssuerSerialNumber.Issuer.cbData;
2878 size +=
in->SignerId.u.IssuerSerialNumber.SerialNumber.cbData;
2905 &
in->SignerId.u.IssuerSerialNumber.Issuer, &nextData);
2907 &
in->SignerId.u.IssuerSerialNumber.SerialNumber, &nextData);
2912 &
in->SignerId.u.KeyId, rdnSize, &nextData);
2926 size +=
in->SerialNumber.cbData;
2927 size +=
in->Issuer.cbData;
2957 switch (dwParamType)
2963 if (
msg->u.enveloped_data.data)
2965 msg->u.enveloped_data.content.pbData,
2966 msg->u.enveloped_data.content.cbData);
2971 if (
msg->u.enveloped_data.data)
2973 &
msg->u.enveloped_data.data->cRecipientInfo,
sizeof(
DWORD));
2978 if (
msg->u.enveloped_data.data)
2980 if (dwIndex < msg->
u.enveloped_data.data->cRecipientInfo)
2983 &
msg->u.enveloped_data.data->rgRecipientInfo[dwIndex];
2995 FIXME(
"unimplemented for %d\n", dwParamType);
3006 switch (dwParamType)
3012 if (
msg->u.signed_data.info)
3014 if (!
strcmp(
msg->u.signed_data.info->content.pszObjId,
3021 msg->u.signed_data.info->content.Content.pbData,
3022 msg->u.signed_data.info->content.Content.cbData,
3033 msg->u.signed_data.info->content.Content.pbData,
3034 msg->u.signed_data.info->content.Content.cbData);
3040 if (
msg->u.signed_data.info)
3042 msg->u.signed_data.info->content.pszObjId,
3043 strlen(
msg->u.signed_data.info->content.pszObjId) + 1);
3048 if (
msg->u.signed_data.info)
3050 &
msg->u.signed_data.info->cSignerInfo,
sizeof(
DWORD));
3055 if (
msg->u.signed_data.info)
3057 if (dwIndex >=
msg->u.signed_data.info->cSignerInfo)
3061 &
msg->u.signed_data.info->rgSignerInfo[dwIndex]);
3067 if (
msg->u.signed_data.info)
3069 if (dwIndex >=
msg->u.signed_data.info->cSignerInfo)
3073 &
msg->u.signed_data.info->rgSignerInfo[dwIndex]);
3079 if (
msg->u.signed_data.info)
3081 &
msg->u.signed_data.info->cCertEncoded,
sizeof(
DWORD));
3086 if (
msg->u.signed_data.info)
3088 if (dwIndex >=
msg->u.signed_data.info->cCertEncoded)
3092 msg->u.signed_data.info->rgCertEncoded[dwIndex].pbData,
3093 msg->u.signed_data.info->rgCertEncoded[dwIndex].cbData);
3099 if (
msg->u.signed_data.info)
3101 &
msg->u.signed_data.info->cCrlEncoded,
sizeof(
DWORD));
3106 if (
msg->u.signed_data.info)
3108 if (dwIndex >=
msg->u.signed_data.info->cCrlEncoded)
3112 msg->u.signed_data.info->rgCrlEncoded[dwIndex].pbData,
3113 msg->u.signed_data.info->rgCrlEncoded[dwIndex].cbData);
3119 if (
msg->u.signed_data.info)
3121 if (dwIndex >=
msg->u.signed_data.cSignerHandle)
3125 msg->u.signed_data.signerHandles[dwIndex].contentHash,
3132 if (
msg->u.signed_data.info)
3134 if (dwIndex >=
msg->u.signed_data.info->cSignerInfo)
3139 &
msg->u.signed_data.info->rgSignerInfo[dwIndex], 0,
NULL,
3146 if (
msg->u.signed_data.info)
3148 DWORD attrCertCount = 0;
3151 &attrCertCount,
sizeof(
DWORD));
3157 if (
msg->u.signed_data.info)
3163 if (
msg->u.signed_data.info)
3165 if (dwIndex >=
msg->u.signed_data.info->cSignerInfo)
3169 &
msg->u.signed_data.info->rgSignerInfo[dwIndex]);
3175 FIXME(
"unimplemented for %d\n", dwParamType);
3202 switch (dwParamType)
3234 DWORD computedHashSize = 0;
3238 if (
hashBlob.cbData == computedHashSize)
3245 computedHash, &computedHashSize);
3278 prov =
msg->crypt_prov;
3285 if (
msg->u.signed_data.info->rgSignerInfo[signerIndex].AuthAttrs.cAttr)
3286 hash =
msg->u.signed_data.signerHandles[signerIndex].authAttrHash;
3288 hash =
msg->u.signed_data.signerHandles[signerIndex].contentHash;
3290 &
msg->u.signed_data.info->rgSignerInfo[signerIndex].EncryptedHash);
3308 if (!
msg->u.signed_data.signerHandles)
3313 for (
i = 0; !
ret &&
i <
msg->u.signed_data.info->cSignerInfo;
i++)
3316 &
msg->u.signed_data.info->rgSignerInfo[
i];
3327 &
info->SerialNumber);
3334 FIXME(
"signer %d: unimplemented for key id\n",
i);
3339 &
info->SubjectPublicKeyInfo);
3355 else if (!
msg->u.signed_data.signerHandles)
3410 pContentEncryptionAlgorithm->
pszObjId);
3412 for (
i = 0;
i < encryptedKey->
cbData; ++
i, --
k)
3413 keyBlob[
k] = encryptedKey->
pbData[
i];
3416 size,
key, 0, phContentEncryptKey);
3436 memset(&decryptPara, 0,
sizeof(decryptPara));
3437 decryptPara.
cbSize =
sizeof(decryptPara);
3446 (
void **)&importKeyFunc, &hFunc);
3449 ret = importKeyFunc(contEncrAlg, &decryptPara, 0,
NULL,
key);
3477 &
data->encryptedContentInfo.contentEncryptionAlgorithm, para,
3494 DWORD dwCtrlType,
const void *pvCtrlPara)
3518 msg->u.enveloped_data.crypt_prov =
3558 TRACE(
"(%08x, %08x, %08x, %08lx, %p, %p)\n", dwMsgEncodingType,
3559 dwFlags, dwMsgType, hCryptProv, pRecipientInfo, pStreamInfo);
3572 msg->type = dwMsgType;
3573 msg->crypt_prov = hCryptProv;
3575 msg->msg_data.cbData = 0;
3577 msg->detached_data.cbData = 0;
3578 msg->detached_data.pbData =
NULL;
3586 TRACE(
"(%p)\n", hCryptMsg);
3599 TRACE(
"(%p)\n", hCryptMsg);
3621 TRACE(
"(%p, %p, %d, %d)\n", hCryptMsg,
pbData, cbData, fFinal);
3623 return msg->update(hCryptMsg,
pbData, cbData, fFinal);
3631 TRACE(
"(%p, %d, %d, %p, %p)\n", hCryptMsg, dwParamType, dwIndex,
3637 DWORD dwCtrlType,
const void *pvCtrlPara)
3641 TRACE(
"(%p, %08x, %d, %p)\n", hCryptMsg,
dwFlags, dwCtrlType,
3643 return msg->control(hCryptMsg,
dwFlags, dwCtrlType, pvCtrlPara);
3647 DWORD dwSignerIndex)
3659 dwSignerIndex, certInfo, &
size))
3674 DWORD i, signerIndex = 0;
3722 for (
i = 0; !signerCert &&
i <
count;
i++)
3764 PBYTE pbSignerInfoCountersignature,
DWORD cbSignerInfoCountersignature,
3767 FIXME(
"(%08lx, %08x, %p, %d, %p, %d, %p): stub\n", hCryptProv,
3768 dwEncodingType, pbSignerInfo, cbSignerInfo, pbSignerInfoCountersignature,
3769 cbSignerInfoCountersignature, pciCountersigner);
3775 PBYTE pbSignerInfoCountersignature,
DWORD cbSignerInfoCountersignature,
3778 FIXME(
"(%08lx, %08x, %p, %d, %p, %d, %d, %p, %08x, %p): stub\n", hCryptProv,
3779 dwEncodingType, pbSignerInfo, cbSignerInfo, pbSignerInfoCountersignature,
3792 TRACE(
"(%08x, %p, %p, %08x, %p, %p)\n", dwMsgEncodingType, pCtlInfo,
3818 TRACE(
"(%08x, %p, %d, %p, %08x, %p, %p)\n", dwMsgEncodingType,
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble * u
CRYPT_ALGORITHM_IDENTIFIER algo
static void CSignerInfo_Free(CMSG_CMS_SIGNER_INFO *info)
#define ERROR_INVALID_PARAMETER
PCCERT_CONTEXT WINAPI CertFindCertificateInStore(HCERTSTORE hCertStore, DWORD dwCertEncodingType, DWORD dwFlags, DWORD dwType, const void *pvPara, PCCERT_CONTEXT pPrevCertContext)
HCRYPTMSG WINAPI CryptMsgDuplicate(HCRYPTMSG hCryptMsg)
static void CRecipientInfo_Free(CMSG_KEY_TRANS_RECIPIENT_INFO *info)
HCRYPTOIDFUNCSET WINAPI CryptInitOIDFunctionSet(LPCSTR pszFuncName, DWORD dwFlags)
enum _CryptMsgState CryptMsgState
_In_ DWORD _In_ DWORD _Outptr_opt_ PCCERT_CONTEXT * ppSigner
#define CRYPT_E_MSG_ERROR
static BOOL CDecodeMsg_DecodeSignedContent(CDecodeMsg *msg, const CRYPT_DER_BLOB *blob)
static HCRYPTPROV crypt_prov
#define CMSG_SIGNED_DATA_V1
BOOL CRYPT_AsnEncodePKCSDigestedData(const CRYPT_DIGESTED_DATA *digestedData, void *pvData, DWORD *pcbData) DECLSPEC_HIDDEN
#define CMSG_ATTR_CERT_COUNT_PARAM
#define NTE_BAD_SIGNATURE
void(* CryptMsgCloseFunc)(HCRYPTMSG msg)
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
CRYPT_DATA_BLOB EncryptedHash
#define CMSG_HASH_ALGORITHM_PARAM
static HCRYPTMSG CDataEncodeMsg_Open(DWORD dwFlags, const void *pvMsgEncodeInfo, LPSTR pszInnerContentObjID, PCMSG_STREAM_INFO pStreamInfo)
BOOL WINAPI CryptDecodeObjectEx(DWORD dwCertEncodingType, LPCSTR lpszStructType, const BYTE *pbEncoded, DWORD cbEncoded, DWORD dwFlags, PCRYPT_DECODE_PARA pDecodePara, void *pvStructInfo, DWORD *pcbStructInfo)
static BOOL CDecodeEnvelopedMsg_CrtlDecrypt(CDecodeMsg *msg, PCMSG_CTRL_DECRYPT_PARA para)
static const BYTE serialNumber[]
struct _CEnvelopedDecodeMsg CEnvelopedDecodeMsg
static void CRYPT_CopyBlob(CRYPT_DATA_BLOB *out, const CRYPT_DATA_BLOB *in, LPBYTE *nextData)
#define ALIGN_DWORD_PTR(x)
static BOOL WINAPI CRYPT_ExportKeyTrans(PCMSG_CONTENT_ENCRYPT_INFO pContentEncryptInfo, PCMSG_KEY_TRANS_RECIPIENT_ENCODE_INFO pKeyTransEncodeInfo, PCMSG_KEY_TRANS_ENCRYPT_INFO pKeyTransEncryptInfo, DWORD dwFlags, void *pvReserved)
struct outqueuenode * head
static BOOL CSignedMsgData_AllocateHandles(CSignedMsgData *msg_data)
ACPI_SIZE strlen(const char *String)
static void void SIZE_T *static void(WINAPI *pReleaseActCtx)(HANDLE)
struct _CMSG_SIGNER_INFO CMSG_SIGNER_INFO
BOOL(* CryptMsgControlFunc)(HCRYPTMSG hCryptMsg, DWORD dwFlags, DWORD dwCtrlType, const void *pvCtrlPara)
static BOOL CHashEncodeMsg_Update(HCRYPTMSG hCryptMsg, const BYTE *pbData, DWORD cbData, BOOL fFinal)
static void CContentEncryptInfo_Free(CMSG_CONTENT_ENCRYPT_INFO *info)
BOOL ContextPropertyList_SetProperty(CONTEXT_PROPERTY_LIST *list, DWORD id, const BYTE *pbData, size_t cbData) DECLSPEC_HIDDEN
struct _CryptMsgBase CryptMsgBase
#define CMSG_CMS_SIGNER_INFO_PARAM
BOOL ContextPropertyList_FindProperty(CONTEXT_PROPERTY_LIST *list, DWORD id, PCRYPT_DATA_BLOB blob) DECLSPEC_HIDDEN
BOOL WINAPI CertFreeCertificateContext(PCCERT_CONTEXT pCertContext)
GLuint GLuint GLsizei count
CRYPT_DATA_BLOB EncryptedKey
#define POINTER_ALIGN_DWORD_PTR(p)
static LPVOID WINAPI mem_alloc(size_t size)
PCRYPT_ATTRIBUTE rgUnauthAttr
#define CMSG_HASHED_DATA_PKCS_1_5_VERSION
#define CERT_STORE_PROV_MSG
static CERT_INFO * CRYPT_GetSignerCertInfoFromMsg(HCRYPTMSG msg, DWORD dwSignerIndex)
struct _CSignedEncodeMsg CSignedEncodeMsg
#define CMSG_CTRL_VERIFY_SIGNATURE_EX
static VOID WINAPI mem_free(LPVOID pv)
CRYPT_ATTRIBUTES AuthAttrs
static const BYTE hashBlob[]
BOOL WINAPI CryptEncodeObjectEx(DWORD dwCertEncodingType, LPCSTR lpszStructType, const void *pvStructInfo, DWORD dwFlags, PCRYPT_ENCODE_PARA pEncodePara, void *pvEncoded, DWORD *pcbEncoded)
#define CMSG_CTRL_DECRYPT
#define CMSG_TRUSTED_SIGNER_FLAG
#define CMSG_ATTR_CERT_PARAM
HCRYPTKEY hContentEncryptKey
static BOOL CHashEncodeMsg_GetParam(HCRYPTMSG hCryptMsg, DWORD dwParamType, DWORD dwIndex, void *pvData, DWORD *pcbData)
CRYPT_INTEGER_BLOB SerialNumber
#define CMSG_KEY_TRANS_RECIPIENT
BOOL WINAPI CRYPT_AsnEncodeSequence(DWORD dwCertEncodingType, struct AsnEncodeSequenceItem items[], DWORD cItem, DWORD dwFlags, PCRYPT_ENCODE_PARA pEncodePara, BYTE *pbEncoded, DWORD *pcbEncoded) DECLSPEC_HIDDEN
#define PKCS_7_ASN_ENCODING
static BOOL CRYPT_CopySignerInfo(void *pvData, DWORD *pcbData, const CMSG_CMS_SIGNER_INFO *in)
#define GET_CMSG_ENCODING_TYPE(x)
static void CHashEncodeMsg_Close(HCRYPTMSG hCryptMsg)
BOOL WINAPI CertAddStoreToCollection(HCERTSTORE hCollectionStore, HCERTSTORE hSiblingStore, DWORD dwUpdateFlags, DWORD dwPriority)
static void CRYPT_FixUpAlgorithmID(CRYPT_ALGORITHM_IDENTIFIER *id)
void ContextPropertyList_Free(CONTEXT_PROPERTY_LIST *list) DECLSPEC_HIDDEN
struct _CERT_INFO CERT_INFO