rsaenh: Assign to structs instead of using memcpy.
This commit is contained in:
parent
b6a1529171
commit
038169b6a7
|
@ -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,
|
BOOL duplicate_hash_impl(ALG_ID aiAlgid, CONST HASH_CONTEXT *pSrcHashContext,
|
||||||
HASH_CONTEXT *pDestHashContext)
|
HASH_CONTEXT *pDestHashContext)
|
||||||
{
|
{
|
||||||
memcpy(pDestHashContext, pSrcHashContext, sizeof(HASH_CONTEXT));
|
*pDestHashContext = *pSrcHashContext;
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
@ -227,7 +227,7 @@ BOOL duplicate_key_impl(ALG_ID aiAlgid, CONST KEY_CONTEXT *pSrcKeyContext,
|
||||||
case CALG_AES_128:
|
case CALG_AES_128:
|
||||||
case CALG_AES_192:
|
case CALG_AES_192:
|
||||||
case CALG_AES_256:
|
case CALG_AES_256:
|
||||||
memcpy(pDestKeyContext, pSrcKeyContext, sizeof(KEY_CONTEXT));
|
*pDestKeyContext = *pSrcKeyContext;
|
||||||
break;
|
break;
|
||||||
case CALG_RSA_KEYX:
|
case CALG_RSA_KEYX:
|
||||||
case CALG_RSA_SIGN:
|
case CALG_RSA_SIGN:
|
||||||
|
|
|
@ -548,7 +548,7 @@ static BOOL copy_hmac_info(PHMAC_INFO *dst, const HMAC_INFO *src) {
|
||||||
if (!src) return FALSE;
|
if (!src) return FALSE;
|
||||||
*dst = HeapAlloc(GetProcessHeap(), 0, sizeof(HMAC_INFO));
|
*dst = HeapAlloc(GetProcessHeap(), 0, sizeof(HMAC_INFO));
|
||||||
if (!*dst) return FALSE;
|
if (!*dst) return FALSE;
|
||||||
memcpy(*dst, src, sizeof(HMAC_INFO));
|
**dst = *src;
|
||||||
(*dst)->pbInnerString = NULL;
|
(*dst)->pbInnerString = NULL;
|
||||||
(*dst)->pbOuterString = NULL;
|
(*dst)->pbOuterString = NULL;
|
||||||
if ((*dst)->cbInnerString == 0) (*dst)->cbInnerString = RSAENH_HMAC_DEF_PAD_LEN;
|
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);
|
destroy_hash, (OBJECTHDR**)&pDestHash);
|
||||||
if (*phHash != (HCRYPTHASH)INVALID_HANDLE_VALUE)
|
if (*phHash != (HCRYPTHASH)INVALID_HANDLE_VALUE)
|
||||||
{
|
{
|
||||||
memcpy(pDestHash, pSrcHash, sizeof(CRYPTHASH));
|
*pDestHash = *pSrcHash;
|
||||||
duplicate_hash_impl(pSrcHash->aiAlgid, &pSrcHash->context, &pDestHash->context);
|
duplicate_hash_impl(pSrcHash->aiAlgid, &pSrcHash->context, &pDestHash->context);
|
||||||
copy_hmac_info(&pDestHash->pHMACInfo, pSrcHash->pHMACInfo);
|
copy_hmac_info(&pDestHash->pHMACInfo, pSrcHash->pHMACInfo);
|
||||||
copy_data_blob(&pDestHash->tpPRFParams.blobLabel, &pSrcHash->tpPRFParams.blobLabel);
|
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);
|
(OBJECTHDR**)&pDestKey);
|
||||||
if (*phKey != (HCRYPTKEY)INVALID_HANDLE_VALUE)
|
if (*phKey != (HCRYPTKEY)INVALID_HANDLE_VALUE)
|
||||||
{
|
{
|
||||||
memcpy(pDestKey, pSrcKey, sizeof(CRYPTKEY));
|
*pDestKey = *pSrcKey;
|
||||||
copy_data_blob(&pDestKey->siSChannelInfo.blobServerRandom,
|
copy_data_blob(&pDestKey->siSChannelInfo.blobServerRandom,
|
||||||
&pSrcKey->siSChannelInfo.blobServerRandom);
|
&pSrcKey->siSChannelInfo.blobServerRandom);
|
||||||
copy_data_blob(&pDestKey->siSChannelInfo.blobClientRandom,
|
copy_data_blob(&pDestKey->siSChannelInfo.blobClientRandom,
|
||||||
|
|
Loading…
Reference in New Issue