crypt32: remove hardcoded value AT_SIGNATURE from CertContext_SetKeyProvInfo

Mounir IDRASSI mounir.idrassi at idrix.fr
Wed May 9 07:28:38 CDT 2007


Hi,
This patch removed a hardcoded value (AT_SIGNATURE) from
CertContext_SetKeyProvInfo. It also corrects a corresponding test.

Mounir IDRASSI
IDRIX - Cryptography and IT Security Experts
http://www.idrix.fr

-------------- next part --------------
>From e5ea0543165c8871eec8133572d482ba42ecf71a Mon Sep 17 00:00:00 2001
From: Mounir IDRASSI <mounir.idrassi at idrix.fr>
Date: Wed, 9 May 2007 14:24:51 +0200
Subject: crypt32: remove hardcoded value AT_SIGNATURE from CertContext_SetKeyProvInfo

---
 dlls/crypt32/cert.c       |    3 +--
 dlls/crypt32/tests/cert.c |    4 ++--
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/dlls/crypt32/cert.c b/dlls/crypt32/cert.c
index d20a49f..132ed2a 100644
--- a/dlls/crypt32/cert.c
+++ b/dlls/crypt32/cert.c
@@ -1972,8 +1972,7 @@ static void CertContext_SetKeyProvInfo(PCCERT_CONTEXT context,
         size = sizeof(info.dwKeySpec);
         ret = CryptGetProvParam(hProv, PP_KEYSPEC, (LPBYTE)&info.dwKeySpec,
          &size, 0);
-        if (!ret)
-            info.dwKeySpec = AT_SIGNATURE;
+
         size = sizeof(info.dwProvType);
         ret = CryptGetProvParam(hProv, PP_PROVTYPE, (LPBYTE)&info.dwProvType,
          &size, 0);
diff --git a/dlls/crypt32/tests/cert.c b/dlls/crypt32/tests/cert.c
index 345c9f5..ca79dc3 100644
--- a/dlls/crypt32/tests/cert.c
+++ b/dlls/crypt32/tests/cert.c
@@ -1212,8 +1212,8 @@ static void testCreateSelfSignCert(void)
                          "Unexpected key container\n");
                         ok(!lstrcmpW(info->pwszProvName, MS_DEF_PROV_W),
                          "Unexpected provider\n");
-                        ok(info->dwKeySpec == AT_SIGNATURE,
-                         "Expected AT_SIGNATURE, got %d\n", info->dwKeySpec);
+                        ok(info->dwKeySpec == (AT_SIGNATURE|AT_KEYEXCHANGE),
+                         "Expected (AT_SIGNATURE|AT_KEY_EXCHANGE), got %d\n", info->dwKeySpec);
                     }
                     HeapFree(GetProcessHeap(), 0, info);
                 }
-- 
1.4.4.2



More information about the wine-patches mailing list