Commit 0d0906b5 authored by Vijay Kiran Kamuju's avatar Vijay Kiran Kamuju Committed by Alexandre Julliard

crypt32: Add CMSG_SIGNER_UNAUTH_ATTR_PARAM implementation.

parent c666a455
......@@ -2999,6 +2999,37 @@ static BOOL CDecodeEnvelopedMsg_GetParam(CDecodeMsg *msg, DWORD dwParamType,
return ret;
}
static BOOL CRYPT_CopyUnauthAttr(void *pvData, DWORD *pcbData,
const CMSG_CMS_SIGNER_INFO *in)
{
DWORD size;
BOOL ret;
TRACE("(%p, %d, %p)\n", pvData, pvData ? *pcbData : 0, in);
size = CRYPT_SizeOfAttributes(&in->UnauthAttrs);
if (!pvData)
{
*pcbData = size;
ret = TRUE;
}
else if (*pcbData < size)
{
*pcbData = size;
SetLastError(ERROR_MORE_DATA);
ret = FALSE;
}
else
{
CRYPT_ATTRIBUTES *out = pvData;
CRYPT_ConstructAttributes(out,&in->UnauthAttrs);
ret = TRUE;
}
TRACE("returning %d\n", ret);
return ret;
}
static BOOL CDecodeSignedMsg_GetParam(CDecodeMsg *msg, DWORD dwParamType,
DWORD dwIndex, void *pvData, DWORD *pcbData)
{
......@@ -3172,6 +3203,18 @@ static BOOL CDecodeSignedMsg_GetParam(CDecodeMsg *msg, DWORD dwParamType,
else
SetLastError(CRYPT_E_INVALID_MSG_TYPE);
break;
case CMSG_SIGNER_UNAUTH_ATTR_PARAM:
if (msg->u.signed_data.info)
{
if (dwIndex >= msg->u.signed_data.info->cSignerInfo)
SetLastError(CRYPT_E_INVALID_INDEX);
else
ret = CRYPT_CopyUnauthAttr(pvData, pcbData,
&msg->u.signed_data.info->rgSignerInfo[dwIndex]);
}
else
SetLastError(CRYPT_E_INVALID_MSG_TYPE);
break;
default:
FIXME("unimplemented for %d\n", dwParamType);
SetLastError(CRYPT_E_INVALID_MSG_TYPE);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment