Commit 038169b6 authored by Andrew Talbot's avatar Andrew Talbot Committed by Alexandre Julliard

rsaenh: Assign to structs instead of using memcpy.

parent b6a15291
......@@ -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:
......
......@@ -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,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment