From 038169b6a7014417305742e8c323c79585ce5b46 Mon Sep 17 00:00:00 2001 From: Andrew Talbot Date: Sat, 15 Mar 2008 23:25:38 +0000 Subject: [PATCH] rsaenh: Assign to structs instead of using memcpy. --- dlls/rsaenh/implglue.c | 4 ++-- dlls/rsaenh/rsaenh.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/dlls/rsaenh/implglue.c b/dlls/rsaenh/implglue.c index bb39a7b8c45..68a9380f6a7 100644 --- a/dlls/rsaenh/implglue.c +++ b/dlls/rsaenh/implglue.c @@ -134,7 +134,7 @@ BOOL finalize_hash_impl(ALG_ID aiAlgid, HASH_CONTEXT *pHashContext, BYTE *pbHash BOOL duplicate_hash_impl(ALG_ID aiAlgid, CONST HASH_CONTEXT *pSrcHashContext, HASH_CONTEXT *pDestHashContext) { - memcpy(pDestHashContext, pSrcHashContext, sizeof(HASH_CONTEXT)); + *pDestHashContext = *pSrcHashContext; return TRUE; } @@ -227,7 +227,7 @@ BOOL duplicate_key_impl(ALG_ID aiAlgid, CONST KEY_CONTEXT *pSrcKeyContext, case CALG_AES_128: case CALG_AES_192: case CALG_AES_256: - memcpy(pDestKeyContext, pSrcKeyContext, sizeof(KEY_CONTEXT)); + *pDestKeyContext = *pSrcKeyContext; break; case CALG_RSA_KEYX: case CALG_RSA_SIGN: diff --git a/dlls/rsaenh/rsaenh.c b/dlls/rsaenh/rsaenh.c index ded6df7c074..e31bace28b5 100644 --- a/dlls/rsaenh/rsaenh.c +++ b/dlls/rsaenh/rsaenh.c @@ -548,7 +548,7 @@ static BOOL copy_hmac_info(PHMAC_INFO *dst, const HMAC_INFO *src) { if (!src) return FALSE; *dst = HeapAlloc(GetProcessHeap(), 0, sizeof(HMAC_INFO)); if (!*dst) return FALSE; - memcpy(*dst, src, sizeof(HMAC_INFO)); + **dst = *src; (*dst)->pbInnerString = NULL; (*dst)->pbOuterString = NULL; if ((*dst)->cbInnerString == 0) (*dst)->cbInnerString = RSAENH_HMAC_DEF_PAD_LEN; @@ -1837,7 +1837,7 @@ BOOL WINAPI RSAENH_CPDuplicateHash(HCRYPTPROV hUID, HCRYPTHASH hHash, DWORD *pdw destroy_hash, (OBJECTHDR**)&pDestHash); if (*phHash != (HCRYPTHASH)INVALID_HANDLE_VALUE) { - memcpy(pDestHash, pSrcHash, sizeof(CRYPTHASH)); + *pDestHash = *pSrcHash; duplicate_hash_impl(pSrcHash->aiAlgid, &pSrcHash->context, &pDestHash->context); copy_hmac_info(&pDestHash->pHMACInfo, pSrcHash->pHMACInfo); copy_data_blob(&pDestHash->tpPRFParams.blobLabel, &pSrcHash->tpPRFParams.blobLabel); @@ -1893,7 +1893,7 @@ BOOL WINAPI RSAENH_CPDuplicateKey(HCRYPTPROV hUID, HCRYPTKEY hKey, DWORD *pdwRes (OBJECTHDR**)&pDestKey); if (*phKey != (HCRYPTKEY)INVALID_HANDLE_VALUE) { - memcpy(pDestKey, pSrcKey, sizeof(CRYPTKEY)); + *pDestKey = *pSrcKey; copy_data_blob(&pDestKey->siSChannelInfo.blobServerRandom, &pSrcKey->siSChannelInfo.blobServerRandom); copy_data_blob(&pDestKey->siSChannelInfo.blobClientRandom,