Juan Lang : crypt32: Remove bad special case, it isn' t necessary since the outer content specifies the hash algorithm.

Alexandre Julliard julliard at wine.codeweavers.com
Wed Aug 1 05:16:50 CDT 2007


Module: wine
Branch: master
Commit: db513c0cb57c1c6e6760562eabf43c69ab750ba4
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=db513c0cb57c1c6e6760562eabf43c69ab750ba4

Author: Juan Lang <juan.lang at gmail.com>
Date:   Tue Jul 31 14:59:04 2007 -0700

crypt32: Remove bad special case, it isn't necessary since the outer content specifies the hash algorithm.

---

 dlls/crypt32/cert.c |   31 +++++--------------------------
 1 files changed, 5 insertions(+), 26 deletions(-)

diff --git a/dlls/crypt32/cert.c b/dlls/crypt32/cert.c
index de1d5e0..940778d 100644
--- a/dlls/crypt32/cert.c
+++ b/dlls/crypt32/cert.c
@@ -1353,37 +1353,16 @@ static BOOL CRYPT_VerifyCertSignatureFromPublicKeyInfo(HCRYPTPROV hCryptProv,
 
     info = CryptFindOIDInfo(CRYPT_OID_INFO_OID_KEY,
      signedCert->SignatureAlgorithm.pszObjId, 0);
-    if (!info || (info->dwGroupId != CRYPT_PUBKEY_ALG_OID_GROUP_ID &&
-     info->dwGroupId != CRYPT_SIGN_ALG_OID_GROUP_ID))
+    if (!info || info->dwGroupId != CRYPT_SIGN_ALG_OID_GROUP_ID)
     {
         SetLastError(NTE_BAD_ALGID);
         return FALSE;
     }
-    if (info->dwGroupId == CRYPT_PUBKEY_ALG_OID_GROUP_ID)
-    {
-        switch (info->u.Algid)
-        {
-            case CALG_RSA_KEYX:
-                pubKeyID = CALG_RSA_SIGN;
-                hashID = CALG_SHA1;
-                break;
-            case CALG_RSA_SIGN:
-                pubKeyID = CALG_RSA_SIGN;
-                hashID = CALG_SHA1;
-                break;
-            default:
-                FIXME("unimplemented for %s\n", pubKeyInfo->Algorithm.pszObjId);
-                return FALSE;
-        }
-    }
+    hashID = info->u.Algid;
+    if (info->ExtraInfo.cbData >= sizeof(ALG_ID))
+        pubKeyID = *(ALG_ID *)info->ExtraInfo.pbData;
     else
-    {
-        hashID = info->u.Algid;
-        if (info->ExtraInfo.cbData >= sizeof(ALG_ID))
-            pubKeyID = *(ALG_ID *)info->ExtraInfo.pbData;
-        else
-            pubKeyID = hashID;
-    }
+        pubKeyID = hashID;
     /* Load the default provider if necessary */
     if (!hCryptProv)
         hCryptProv = CRYPT_GetDefaultProvider();




More information about the wine-cvs mailing list