summaryrefslogtreecommitdiff
path: root/core/fpdfapi/parser
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-11-21 14:29:12 -0800
committerCommit bot <commit-bot@chromium.org>2016-11-21 14:29:12 -0800
commitd88090fb780480217af37273e7abb01ae48e322b (patch)
tree6c4287e91c123fe8e9c281be996ea62dc4615dae /core/fpdfapi/parser
parentbcd3e538f170a5ab2c3295f1a3b0062781d384a5 (diff)
downloadpdfium-d88090fb780480217af37273e7abb01ae48e322b.tar.xz
Remove some void* usage in fx_crypt.cpp
Review-Url: https://codereview.chromium.org/2521693003
Diffstat (limited to 'core/fpdfapi/parser')
-rw-r--r--core/fpdfapi/parser/cpdf_crypto_handler.cpp7
1 files changed, 4 insertions, 3 deletions
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<CRYPT_rc4_context*>(context),
+ dest_buf.GetBuffer() + old_size, src_size);
return true;
}
- AESCryptContext* pContext = (AESCryptContext*)context;
+ AESCryptContext* pContext = reinterpret_cast<AESCryptContext*>(context);
if (pContext->m_bIV && bEncrypt) {
dest_buf.AppendBlock(pContext->m_Block, 16);
pContext->m_bIV = false;