crypt32: Implement retrieving the encoded signer of a decoded signed message

Juan Lang juan.lang at gmail.com
Mon Sep 14 10:03:00 CDT 2009


Fixes bug 20011.
--Juan
-------------- next part --------------
From 11f211824fd1af4e8fe7de1e9785c851e3074035 Mon Sep 17 00:00:00 2001
From: Juan Lang <juan.lang at gmail.com>
Date: Mon, 14 Sep 2009 08:01:43 -0700
Subject: [PATCH 6/6] Implement retrieving the encoded signer of a decoded signed message

---
 dlls/crypt32/msg.c |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/dlls/crypt32/msg.c b/dlls/crypt32/msg.c
index 0b4027d..8a88b75 100644
--- a/dlls/crypt32/msg.c
+++ b/dlls/crypt32/msg.c
@@ -2410,6 +2410,20 @@ static BOOL CDecodeSignedMsg_GetParam(CDecodeMsg *msg, DWORD dwParamType,
         else
             SetLastError(CRYPT_E_INVALID_MSG_TYPE);
         break;
+    case CMSG_ENCODED_SIGNER:
+        if (msg->u.signed_data.info)
+        {
+            if (dwIndex >= msg->u.signed_data.info->cSignerInfo)
+                SetLastError(CRYPT_E_INVALID_INDEX);
+            else
+                ret = CryptEncodeObjectEx(
+                 X509_ASN_ENCODING | PKCS_7_ASN_ENCODING, CMS_SIGNER_INFO,
+                 &msg->u.signed_data.info->rgSignerInfo[dwIndex], 0, NULL,
+                 pvData, pcbData);
+        }
+        else
+            SetLastError(CRYPT_E_INVALID_MSG_TYPE);
+        break;
     case CMSG_ATTR_CERT_COUNT_PARAM:
         if (msg->u.signed_data.info)
         {
-- 
1.6.3.2


More information about the wine-patches mailing list