Jacek Caban : rsaenh: Removed no longer needed ALG_ID argument from helper functions.

Alexandre Julliard julliard at winehq.org
Thu Dec 7 16:02:44 CST 2017


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

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Thu Dec  7 19:47:21 2017 +0100

rsaenh: Removed no longer needed ALG_ID argument from helper functions.

Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/rsaenh/implglue.c |  8 +++-----
 dlls/rsaenh/implglue.h |  6 +++---
 dlls/rsaenh/rsaenh.c   | 21 +++++++++------------
 3 files changed, 15 insertions(+), 20 deletions(-)

diff --git a/dlls/rsaenh/implglue.c b/dlls/rsaenh/implglue.c
index f12fc78..76c2b1f 100644
--- a/dlls/rsaenh/implglue.c
+++ b/dlls/rsaenh/implglue.c
@@ -82,22 +82,20 @@ BOOL init_hash_impl(ALG_ID aiAlgid, HASH_CONTEXT *pHashContext)
     return !status;
 }
 
-BOOL update_hash_impl(ALG_ID aiAlgid, HASH_CONTEXT *pHashContext, const BYTE *pbData,
-                      DWORD dwDataLen) 
+BOOL update_hash_impl(HASH_CONTEXT *pHashContext, const BYTE *pbData, DWORD dwDataLen)
 {
     BCryptHashData(pHashContext->bcrypt_hash, (UCHAR*)pbData, dwDataLen, 0);
     return TRUE;
 }
 
-BOOL finalize_hash_impl(ALG_ID aiAlgid, HASH_CONTEXT *pHashContext, BYTE *pbHashValue) 
+BOOL finalize_hash_impl(HASH_CONTEXT *pHashContext, BYTE *pbHashValue)
 {
     BCryptFinishHash(pHashContext->bcrypt_hash, pbHashValue, RSAENH_MAX_HASH_SIZE, 0);
     BCryptDestroyHash(pHashContext->bcrypt_hash);
     return TRUE;
 }
 
-BOOL duplicate_hash_impl(ALG_ID aiAlgid, const HASH_CONTEXT *pSrcHashContext,
-                         HASH_CONTEXT *pDestHashContext) 
+BOOL duplicate_hash_impl(const HASH_CONTEXT *pSrcHashContext, HASH_CONTEXT *pDestHashContext)
 {
     return !BCryptDuplicateHash(pSrcHashContext->bcrypt_hash, &pDestHashContext->bcrypt_hash, NULL, 0, 0);
 }
diff --git a/dlls/rsaenh/implglue.h b/dlls/rsaenh/implglue.h
index 92323ca..9be642e 100644
--- a/dlls/rsaenh/implglue.h
+++ b/dlls/rsaenh/implglue.h
@@ -43,10 +43,10 @@ typedef union tagKEY_CONTEXT {
 } KEY_CONTEXT;
 
 BOOL init_hash_impl(ALG_ID aiAlgid, HASH_CONTEXT *pHashContext) DECLSPEC_HIDDEN;
-BOOL update_hash_impl(ALG_ID aiAlgid, HASH_CONTEXT *pHashContext, const BYTE *pbData,
+BOOL update_hash_impl(HASH_CONTEXT *pHashContext, const BYTE *pbData,
                       DWORD dwDataLen) DECLSPEC_HIDDEN;
-BOOL finalize_hash_impl(ALG_ID aiAlgid, HASH_CONTEXT *pHashContext, BYTE *pbHashValue) DECLSPEC_HIDDEN;
-BOOL duplicate_hash_impl(ALG_ID aiAlgid, const HASH_CONTEXT *pSrcHashContext,
+BOOL finalize_hash_impl(HASH_CONTEXT *pHashContext, BYTE *pbHashValue) DECLSPEC_HIDDEN;
+BOOL duplicate_hash_impl(const HASH_CONTEXT *pSrcHashContext,
                          HASH_CONTEXT *pDestHashContext) DECLSPEC_HIDDEN;
 
 BOOL new_key_impl(ALG_ID aiAlgid, KEY_CONTEXT *pKeyContext, DWORD dwKeyLen) DECLSPEC_HIDDEN;
diff --git a/dlls/rsaenh/rsaenh.c b/dlls/rsaenh/rsaenh.c
index fdf410a..1332073 100644
--- a/dlls/rsaenh/rsaenh.c
+++ b/dlls/rsaenh/rsaenh.c
@@ -635,7 +635,7 @@ static inline BOOL init_hash(CRYPTHASH *pCryptHash) {
                 if (!pAlgInfo) return FALSE;
                 pCryptHash->dwHashSize = pAlgInfo->dwDefaultLen >> 3;
                 init_hash_impl(pCryptHash->pHMACInfo->HashAlgid, &pCryptHash->context);
-                update_hash_impl(pCryptHash->pHMACInfo->HashAlgid, &pCryptHash->context,
+                update_hash_impl(&pCryptHash->context,
                                  pCryptHash->pHMACInfo->pbInnerString, 
                                  pCryptHash->pHMACInfo->cbInnerString);
             }
@@ -671,8 +671,7 @@ static inline void update_hash(CRYPTHASH *pCryptHash, const BYTE *pbData, DWORD
     {
         case CALG_HMAC:
             if (pCryptHash->pHMACInfo) 
-                update_hash_impl(pCryptHash->pHMACInfo->HashAlgid, &pCryptHash->context, 
-                                 pbData, dwDataLen);
+                update_hash_impl(&pCryptHash->context,  pbData, dwDataLen);
             break;
 
         case CALG_MAC:
@@ -685,7 +684,7 @@ static inline void update_hash(CRYPTHASH *pCryptHash, const BYTE *pbData, DWORD
             break;
 
         default:
-            update_hash_impl(pCryptHash->aiAlgid, &pCryptHash->context, pbData, dwDataLen);
+            update_hash_impl(&pCryptHash->context, pbData, dwDataLen);
     }
 }
 
@@ -707,17 +706,15 @@ static inline void finalize_hash(CRYPTHASH *pCryptHash) {
             if (pCryptHash->pHMACInfo) {
                 BYTE abHashValue[RSAENH_MAX_HASH_SIZE];
 
-                finalize_hash_impl(pCryptHash->pHMACInfo->HashAlgid, &pCryptHash->context, 
-                                   pCryptHash->abHashValue);
+                finalize_hash_impl(&pCryptHash->context, pCryptHash->abHashValue);
                 memcpy(abHashValue, pCryptHash->abHashValue, pCryptHash->dwHashSize);
                 init_hash_impl(pCryptHash->pHMACInfo->HashAlgid, &pCryptHash->context);
-                update_hash_impl(pCryptHash->pHMACInfo->HashAlgid, &pCryptHash->context,
+                update_hash_impl(&pCryptHash->context,
                                  pCryptHash->pHMACInfo->pbOuterString, 
                                  pCryptHash->pHMACInfo->cbOuterString);
-                update_hash_impl(pCryptHash->pHMACInfo->HashAlgid, &pCryptHash->context,
+                update_hash_impl(&pCryptHash->context,
                                  abHashValue, pCryptHash->dwHashSize);
-                finalize_hash_impl(pCryptHash->pHMACInfo->HashAlgid, &pCryptHash->context,
-                                   pCryptHash->abHashValue);
+                finalize_hash_impl(&pCryptHash->context, pCryptHash->abHashValue);
             } 
             break;
 
@@ -728,7 +725,7 @@ static inline void finalize_hash(CRYPTHASH *pCryptHash) {
             break;
 
         default:
-            finalize_hash_impl(pCryptHash->aiAlgid, &pCryptHash->context, pCryptHash->abHashValue);
+            finalize_hash_impl(&pCryptHash->context, pCryptHash->abHashValue);
     }
 }
 
@@ -2069,7 +2066,7 @@ BOOL WINAPI RSAENH_CPDuplicateHash(HCRYPTPROV hUID, HCRYPTHASH hHash, DWORD *pdw
     if (*phHash != (HCRYPTHASH)INVALID_HANDLE_VALUE)
     {
         *pDestHash = *pSrcHash;
-        duplicate_hash_impl(pSrcHash->aiAlgid, &pSrcHash->context, &pDestHash->context);
+        duplicate_hash_impl(&pSrcHash->context, &pDestHash->context);
         copy_hmac_info(&pDestHash->pHMACInfo, pSrcHash->pHMACInfo);
         copy_data_blob(&pDestHash->tpPRFParams.blobLabel, &pSrcHash->tpPRFParams.blobLabel);
         copy_data_blob(&pDestHash->tpPRFParams.blobSeed, &pSrcHash->tpPRFParams.blobSeed);




More information about the wine-cvs mailing list