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);
1637 info->rgCmsRecipients[
i].u.pKeyTrans;
1641 memset(&encryptInfo, 0,
sizeof(encryptInfo));
1642 encryptInfo.
cbSize =
sizeof(encryptInfo);
1656 ret = exportKeyFunc(
info, encodeInfo, &encryptInfo, 0,
NULL);
1688 info->hCryptProv = prov;
1690 &
in->ContentEncryptionAlgorithm);
1691 info->pvEncryptionAuxInfo =
in->pvEncryptionAuxInfo;
1692 info->cRecipients =
in->cRecipients;
1697 if (
info->rgCmsRecipients)
1701 for (
i = 0;
ret &&
i <
in->cRecipients; ++
i)
1706 info->rgCmsRecipients[
i].dwRecipientChoice =
1709 info->rgCmsRecipients[
i].u.pKeyTrans = encodeInfo;
1712 encodeInfo->
cbSize =
sizeof(*encodeInfo);
1715 &
cert->SubjectPublicKeyInfo.Algorithm);
1721 &
cert->SubjectPublicKeyInfo.PublicKey);
1729 &
cert->SerialNumber);
1747 if (
info->rgCmsRecipients)
1751 for (
i = 0;
i <
info->cRecipients; ++
i)
1754 info->rgCmsRecipients[
i].u.pKeyTrans;
1780 &
info->RecipientId.u.IssuerSerialNumber.SerialNumber,
1781 &
cert->SerialNumber);
1784 &
cert->SubjectPublicKeyInfo.Algorithm);
1785 info->EncryptedKey.cbData =
key->cbData;
1786 info->EncryptedKey.pbData =
key->pbData;
1808 if (
msg->recipientInfo)
1812 for (
i = 0;
i <
msg->cRecipientInfo; ++
i)
1825 switch (dwParamType)
1828 if (
msg->base.streamed)
1835 msg->recipientInfo, { oid_rsa_data, {
1837 {
msg->algo.Parameters.cbData,
msg->algo.Parameters.pbData }
1839 {
msg->data.cbData,
msg->data.pbData }
1852 &
info.Content.cbData);
1856 if (
info.Content.pbData)
1859 info.Content.pbData, &
info.Content.cbData);
1864 info.pszObjId = oid_rsa_enveloped;
1889 else if (
msg->base.streamed)
1891 FIXME(
"streamed stub\n");
1908 DWORD dataLen = cbData;
1910 msg->data.cbData = cbData;
1912 if (
msg->data.pbData)
1916 &dataLen,
msg->data.cbData);
1917 msg->data.cbData = dataLen;
1918 if (dataLen > cbData)
1922 if (
msg->data.pbData)
1926 msg->data.pbData, &dataLen,
msg->data.cbData);
1938 msg->data.cbData = 0;
1951 const void *pvMsgEncodeInfo,
LPCSTR pszInnerContentObjID,
1966 FIXME(
"CMS fields unsupported\n");
1972 if (
info->cRecipients && !
info->rgpRecipientCert)
1977 if (
info->hCryptProv)
1978 prov =
info->hCryptProv;
1996 &
info->ContentEncryptionAlgorithm);
1998 msg->data.cbData = 0;
2000 msg->cRecipientInfo =
info->cRecipients;
2003 if (!
msg->recipientInfo)
2005 memset(&encryptInfo, 0,
sizeof(encryptInfo));
2016 for (
i = 0;
ret &&
i <
msg->cRecipientInfo; ++
i)
2021 info->rgpRecipientCert[
i], &encryptedKey);
2036 DWORD dwMsgType,
const void *pvMsgEncodeInfo,
LPSTR pszInnerContentObjID,
2041 TRACE(
"(%08x, %08x, %08x, %p, %s, %p)\n", dwMsgEncodingType,
dwFlags,
2042 dwMsgType, pvMsgEncodeInfo,
debugstr_a(pszInnerContentObjID), pStreamInfo);
2053 pszInnerContentObjID, pStreamInfo);
2057 pszInnerContentObjID, pStreamInfo);
2061 pszInnerContentObjID, pStreamInfo);
2065 pszInnerContentObjID, pStreamInfo);
2112 if (
msg->u.enveloped_data.crypt_prov)
2118 if (
msg->u.signed_data.info)
2139 blob->cbData + cbData);
2145 blob->cbData += cbData;
2179 len +=
id->Parameters.cbData;
2189 if (
id->Parameters.cbData ==
sizeof(nullParams) &&
2190 !
memcmp(
id->Parameters.pbData, nullParams,
sizeof(nullParams)))
2192 copy->Parameters.cbData = 0;
2193 len -=
sizeof(nullParams);
2196 copy->Parameters.cbData =
id->Parameters.cbData;
2197 if (
copy->Parameters.cbData)
2199 id->Parameters.cbData);
2209 id->Parameters.pbData = (
BYTE *)
id->pszObjId +
strlen(
id->pszObjId) + 1;
2260 msg->u.enveloped_data.data = envelopedData;
2275 msg->u.signed_data.info = signedInfo;
2355 if (!
msg->crypt_prov)
2358 if (
msg->crypt_prov)
2394 &
msg->u.enveloped_data.data->encryptedContentInfo.encryptedContent;
2406 for (
i = 0;
ret &&
i <
msg->u.signed_data.info->cSignerInfo;
i++)
2408 &
msg->crypt_prov, &
msg->base.open_flags);
2421 content = &
msg->u.signed_data.info->content.Content;
2428 !
strcmp(
msg->u.signed_data.info->content.pszObjId,
2478 TRACE(
"(%p, %p, %d, %d)\n", hCryptMsg,
pbData, cbData, fFinal);
2482 else if (
msg->base.streamed)
2484 FIXME(
"(%p, %p, %d, %d): streamed update stub\n", hCryptMsg,
pbData,
2486 switch (
msg->base.state)
2526 switch (
msg->base.state)
2544 if (
ret && fFinal &&
2560 switch (dwParamType)
2606 out->cbData =
in->cbData;
2609 out->pbData = *nextData;
2611 *nextData +=
in->cbData;
2630 out->cAttr =
in->cAttr;
2638 for (
i = 0;
i <
in->cAttr;
i++)
2640 if (
in->rgAttr[
i].pszObjId)
2642 out->rgAttr[
i].pszObjId = (
LPSTR)*nextData;
2644 *nextData +=
strlen(
in->rgAttr[
i].pszObjId) + 1;
2646 if (
in->rgAttr[
i].cValue)
2650 out->rgAttr[
i].cValue =
in->rgAttr[
i].cValue;
2654 for (
j = 0;
j <
in->rgAttr[
i].cValue;
j++)
2656 &
in->rgAttr[
i].rgValue[
j], nextData);
2666 for (
i = 0;
i <
attr->cAttr;
i++)
2668 if (
attr->rgAttr[
i].pszObjId)
2673 for (
j = 0;
j <
attr->rgAttr[
i].cValue;
j++)
2689 attr.pszObjId = oid_key_rdn;
2714 issuer->pbData = *nextData;
2715 attr.pszObjId = oid_key_rdn;
2723 *nextData += encodedLen;
2724 issuer->cbData = encodedLen;
2739 size +=
in->SignerId.u.IssuerSerialNumber.Issuer.cbData;
2740 size +=
in->SignerId.u.IssuerSerialNumber.SerialNumber.cbData;
2747 if (
in->HashAlgorithm.pszObjId)
2749 size +=
in->HashAlgorithm.Parameters.cbData;
2750 if (
in->HashEncryptionAlgorithm.pszObjId)
2751 size +=
strlen(
in->HashEncryptionAlgorithm.pszObjId) + 1;
2752 size +=
in->HashEncryptionAlgorithm.Parameters.cbData;
2753 size +=
in->EncryptedHash.cbData;
2773 out->dwVersion =
in->dwVersion;
2777 &
in->SignerId.u.IssuerSerialNumber.Issuer, &nextData);
2779 &
in->SignerId.u.IssuerSerialNumber.SerialNumber, &nextData);
2783 &
in->SignerId.u.KeyId, rdnSize, &nextData);
2789 &
in->HashEncryptionAlgorithm, &nextData);
2811 size +=
in->SignerId.u.IssuerSerialNumber.Issuer.cbData;
2812 size +=
in->SignerId.u.IssuerSerialNumber.SerialNumber.cbData;
2815 size +=
in->SignerId.u.KeyId.cbData;
2816 if (
in->HashAlgorithm.pszObjId)
2818 size +=
in->HashAlgorithm.Parameters.cbData;
2819 if (
in->HashEncryptionAlgorithm.pszObjId)
2820 size +=
strlen(
in->HashEncryptionAlgorithm.pszObjId) + 1;
2821 size +=
in->HashEncryptionAlgorithm.Parameters.cbData;
2822 size +=
in->EncryptedHash.cbData;
2843 out->dwVersion =
in->dwVersion;
2844 out->SignerId.dwIdChoice =
in->SignerId.dwIdChoice;
2848 &
in->SignerId.u.IssuerSerialNumber.Issuer, &nextData);
2850 &
in->SignerId.u.IssuerSerialNumber.SerialNumber, &nextData);
2857 &
in->HashEncryptionAlgorithm, &nextData);
2878 size +=
in->SignerId.u.IssuerSerialNumber.Issuer.cbData;
2879 size +=
in->SignerId.u.IssuerSerialNumber.SerialNumber.cbData;
2906 &
in->SignerId.u.IssuerSerialNumber.Issuer, &nextData);
2908 &
in->SignerId.u.IssuerSerialNumber.SerialNumber, &nextData);
2913 &
in->SignerId.u.KeyId, rdnSize, &nextData);
2927 size +=
in->SerialNumber.cbData;
2928 size +=
in->Issuer.cbData;
2958 switch (dwParamType)
2964 if (
msg->u.enveloped_data.data)
2966 msg->u.enveloped_data.content.pbData,
2967 msg->u.enveloped_data.content.cbData);
2972 if (
msg->u.enveloped_data.data)
2974 &
msg->u.enveloped_data.data->cRecipientInfo,
sizeof(
DWORD));
2979 if (
msg->u.enveloped_data.data)
2981 if (dwIndex < msg->
u.enveloped_data.data->cRecipientInfo)
2984 &
msg->u.enveloped_data.data->rgRecipientInfo[dwIndex];
2996 FIXME(
"unimplemented for %d\n", dwParamType);
3007 switch (dwParamType)
3013 if (
msg->u.signed_data.info)
3015 if (!
strcmp(
msg->u.signed_data.info->content.pszObjId,
3022 msg->u.signed_data.info->content.Content.pbData,
3023 msg->u.signed_data.info->content.Content.cbData,
3034 msg->u.signed_data.info->content.Content.pbData,
3035 msg->u.signed_data.info->content.Content.cbData);
3041 if (
msg->u.signed_data.info)
3043 msg->u.signed_data.info->content.pszObjId,
3044 strlen(
msg->u.signed_data.info->content.pszObjId) + 1);
3049 if (
msg->u.signed_data.info)
3051 &
msg->u.signed_data.info->cSignerInfo,
sizeof(
DWORD));
3056 if (
msg->u.signed_data.info)
3058 if (dwIndex >=
msg->u.signed_data.info->cSignerInfo)
3062 &
msg->u.signed_data.info->rgSignerInfo[dwIndex]);
3068 if (
msg->u.signed_data.info)
3070 if (dwIndex >=
msg->u.signed_data.info->cSignerInfo)
3074 &
msg->u.signed_data.info->rgSignerInfo[dwIndex]);
3080 if (
msg->u.signed_data.info)
3082 &
msg->u.signed_data.info->cCertEncoded,
sizeof(
DWORD));
3087 if (
msg->u.signed_data.info)
3089 if (dwIndex >=
msg->u.signed_data.info->cCertEncoded)
3093 msg->u.signed_data.info->rgCertEncoded[dwIndex].pbData,
3094 msg->u.signed_data.info->rgCertEncoded[dwIndex].cbData);
3100 if (
msg->u.signed_data.info)
3102 &
msg->u.signed_data.info->cCrlEncoded,
sizeof(
DWORD));
3107 if (
msg->u.signed_data.info)
3109 if (dwIndex >=
msg->u.signed_data.info->cCrlEncoded)
3113 msg->u.signed_data.info->rgCrlEncoded[dwIndex].pbData,
3114 msg->u.signed_data.info->rgCrlEncoded[dwIndex].cbData);
3120 if (
msg->u.signed_data.info)
3122 if (dwIndex >=
msg->u.signed_data.cSignerHandle)
3126 msg->u.signed_data.signerHandles[dwIndex].contentHash,
3133 if (
msg->u.signed_data.info)
3135 if (dwIndex >=
msg->u.signed_data.info->cSignerInfo)
3140 &
msg->u.signed_data.info->rgSignerInfo[dwIndex], 0,
NULL,
3147 if (
msg->u.signed_data.info)
3149 DWORD attrCertCount = 0;
3152 &attrCertCount,
sizeof(
DWORD));
3158 if (
msg->u.signed_data.info)
3164 if (
msg->u.signed_data.info)
3166 if (dwIndex >=
msg->u.signed_data.info->cSignerInfo)
3170 &
msg->u.signed_data.info->rgSignerInfo[dwIndex]);
3176 FIXME(
"unimplemented for %d\n", dwParamType);
3203 switch (dwParamType)
3235 DWORD computedHashSize = 0;
3239 if (
hashBlob.cbData == computedHashSize)
3246 computedHash, &computedHashSize);
3279 prov =
msg->crypt_prov;
3286 if (
msg->u.signed_data.info->rgSignerInfo[signerIndex].AuthAttrs.cAttr)
3287 hash =
msg->u.signed_data.signerHandles[signerIndex].authAttrHash;
3289 hash =
msg->u.signed_data.signerHandles[signerIndex].contentHash;
3291 &
msg->u.signed_data.info->rgSignerInfo[signerIndex].EncryptedHash);
3309 if (!
msg->u.signed_data.signerHandles)
3314 for (
i = 0; !
ret &&
i <
msg->u.signed_data.info->cSignerInfo;
i++)
3317 &
msg->u.signed_data.info->rgSignerInfo[
i];
3328 &
info->SerialNumber);
3335 FIXME(
"signer %d: unimplemented for key id\n",
i);
3340 &
info->SubjectPublicKeyInfo);
3356 else if (!
msg->u.signed_data.signerHandles)
3411 pContentEncryptionAlgorithm->
pszObjId);
3413 for (
i = 0;
i < encryptedKey->
cbData; ++
i, --
k)
3414 keyBlob[
k] = encryptedKey->
pbData[
i];
3417 size,
key, 0, phContentEncryptKey);
3437 memset(&decryptPara, 0,
sizeof(decryptPara));
3438 decryptPara.
cbSize =
sizeof(decryptPara);
3447 (
void **)&importKeyFunc, &hFunc);
3450 ret = importKeyFunc(contEncrAlg, &decryptPara, 0,
NULL,
key);
3478 &
data->encryptedContentInfo.contentEncryptionAlgorithm, para,
3495 DWORD dwCtrlType,
const void *pvCtrlPara)
3519 msg->u.enveloped_data.crypt_prov =
3559 TRACE(
"(%08x, %08x, %08x, %08lx, %p, %p)\n", dwMsgEncodingType,
3560 dwFlags, dwMsgType, hCryptProv, pRecipientInfo, pStreamInfo);
3573 msg->type = dwMsgType;
3574 msg->crypt_prov = hCryptProv;
3576 msg->msg_data.cbData = 0;
3578 msg->detached_data.cbData = 0;
3579 msg->detached_data.pbData =
NULL;
3587 TRACE(
"(%p)\n", hCryptMsg);
3600 TRACE(
"(%p)\n", hCryptMsg);
3622 TRACE(
"(%p, %p, %d, %d)\n", hCryptMsg,
pbData, cbData, fFinal);
3624 return msg->update(hCryptMsg,
pbData, cbData, fFinal);
3632 TRACE(
"(%p, %d, %d, %p, %p)\n", hCryptMsg, dwParamType, dwIndex,
3638 DWORD dwCtrlType,
const void *pvCtrlPara)
3642 TRACE(
"(%p, %08x, %d, %p)\n", hCryptMsg,
dwFlags, dwCtrlType,
3644 return msg->control(hCryptMsg,
dwFlags, dwCtrlType, pvCtrlPara);
3648 DWORD dwSignerIndex)
3660 dwSignerIndex, certInfo, &
size))
3675 DWORD i, signerIndex = 0;
3723 for (
i = 0; !signerCert &&
i <
count;
i++)
3765 PBYTE pbSignerInfoCountersignature,
DWORD cbSignerInfoCountersignature,
3768 FIXME(
"(%08lx, %08x, %p, %d, %p, %d, %p): stub\n", hCryptProv,
3769 dwEncodingType, pbSignerInfo, cbSignerInfo, pbSignerInfoCountersignature,
3770 cbSignerInfoCountersignature, pciCountersigner);
3776 PBYTE pbSignerInfoCountersignature,
DWORD cbSignerInfoCountersignature,
3779 FIXME(
"(%08lx, %08x, %p, %d, %p, %d, %d, %p, %08x, %p): stub\n", hCryptProv,
3780 dwEncodingType, pbSignerInfo, cbSignerInfo, pbSignerInfoCountersignature,
3793 TRACE(
"(%08x, %p, %p, %08x, %p, %p)\n", dwMsgEncodingType, pCtlInfo,
3819 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
GLuint GLuint GLsizei count
BOOL ContextPropertyList_FindProperty(CONTEXT_PROPERTY_LIST *list, DWORD id, PCRYPT_DATA_BLOB blob) DECLSPEC_HIDDEN
BOOL WINAPI CertFreeCertificateContext(PCCERT_CONTEXT pCertContext)
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
GLuint GLuint GLsizei GLenum type
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
#define CMSG_COMPUTED_HASH_PARAM
BOOL CRYPT_EncodeLen(DWORD len, BYTE *pbEncoded, DWORD *pcbEncoded) DECLSPEC_HIDDEN