From d88090fb780480217af37273e7abb01ae48e322b Mon Sep 17 00:00:00 2001 From: tsepez Date: Mon, 21 Nov 2016 14:29:12 -0800 Subject: Remove some void* usage in fx_crypt.cpp Review-Url: https://codereview.chromium.org/2521693003 --- core/fpdfapi/parser/cpdf_crypto_handler.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'core/fpdfapi') diff --git a/core/fpdfapi/parser/cpdf_crypto_handler.cpp b/core/fpdfapi/parser/cpdf_crypto_handler.cpp index 5918754c5c..61f78c4ee5 100644 --- a/core/fpdfapi/parser/cpdf_crypto_handler.cpp +++ b/core/fpdfapi/parser/cpdf_crypto_handler.cpp @@ -126,7 +126,7 @@ void* CPDF_CryptoHandler::CryptStart(uint32_t objnum, } return pContext; } - void* pContext = FX_Alloc(uint8_t, 1040); + CRYPT_rc4_context* pContext = FX_Alloc(CRYPT_rc4_context, 1); CRYPT_ArcFourSetup(pContext, realkey, realkeylen); return pContext; } @@ -146,10 +146,11 @@ bool CPDF_CryptoHandler::CryptStream(void* context, if (m_Cipher == FXCIPHER_RC4) { int old_size = dest_buf.GetSize(); dest_buf.AppendBlock(src_buf, src_size); - CRYPT_ArcFourCrypt(context, dest_buf.GetBuffer() + old_size, src_size); + CRYPT_ArcFourCrypt(reinterpret_cast(context), + dest_buf.GetBuffer() + old_size, src_size); return true; } - AESCryptContext* pContext = (AESCryptContext*)context; + AESCryptContext* pContext = reinterpret_cast(context); if (pContext->m_bIV && bEncrypt) { dest_buf.AppendBlock(pContext->m_Block, 16); pContext->m_bIV = false; -- cgit v1.2.3