Vijay Kiran Kamuju : crypt32: Add CMSG_SIGNER_UNAUTH_ATTR_PARAM implementation.

Alexandre Julliard julliard at winehq.org
Tue Feb 19 15:29:34 CST 2019


Module: wine
Branch: master
Commit: 0d0906b56d5ffec3a6ae57570860f00dc5e053cf
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=0d0906b56d5ffec3a6ae57570860f00dc5e053cf

Author: Vijay Kiran Kamuju <infyquest at gmail.com>
Date:   Wed Feb 13 05:56:20 2019 +0100

crypt32: Add CMSG_SIGNER_UNAUTH_ATTR_PARAM implementation.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=37837
Signed-off-by: Vijay Kiran Kamuju <infyquest at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/crypt32/msg.c | 43 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 43 insertions(+)

diff --git a/dlls/crypt32/msg.c b/dlls/crypt32/msg.c
index 4132390..ea96248 100644
--- a/dlls/crypt32/msg.c
+++ b/dlls/crypt32/msg.c
@@ -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);




More information about the wine-cvs mailing list