summaryrefslogtreecommitdiff
path: root/core/src/fdrm
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-07-27 11:55:29 -0700
committerTom Sepez <tsepez@chromium.org>2015-07-27 11:55:29 -0700
commitff46aaf499edcf153ee2f57c7016587aa96dcfa0 (patch)
tree0a0d92713af476897899b126d180cc6294433d10 /core/src/fdrm
parentaafeff816e22c1333c17d8a0eb4fe8927c28142d (diff)
downloadpdfium-ff46aaf499edcf153ee2f57c7016587aa96dcfa0.tar.xz
FX Bool considered harmful, part 3
Try to reland this patch after fixing underlying issues that caused it to be reverted. fx_system.h is the only manual edit. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1258093002 .
Diffstat (limited to 'core/src/fdrm')
-rw-r--r--core/src/fdrm/crypto/fx_crypt.cpp4
-rw-r--r--core/src/fdrm/crypto/fx_crypt_aes.cpp2
-rw-r--r--core/src/fdrm/crypto/fx_crypt_sha.cpp2
3 files changed, 4 insertions, 4 deletions
diff --git a/core/src/fdrm/crypto/fx_crypt.cpp b/core/src/fdrm/crypto/fx_crypt.cpp
index 83a420ad38..f19445f8f2 100644
--- a/core/src/fdrm/crypto/fx_crypt.cpp
+++ b/core/src/fdrm/crypto/fx_crypt.cpp
@@ -249,8 +249,8 @@ void CRYPT_MD5Generate(const uint8_t* input, FX_DWORD length, uint8_t digest[16]
CRYPT_MD5Update(&ctx, input, length);
CRYPT_MD5Finish(&ctx, digest);
}
-static FX_BOOL (*g_PubKeyDecryptor)(const uint8_t* pData, FX_DWORD size, uint8_t* data_buf, FX_DWORD& data_len) = NULL;
-void CRYPT_SetPubKeyDecryptor(FX_BOOL (*func)(const uint8_t* pData, FX_DWORD size, uint8_t* data_buf, FX_DWORD& data_len))
+static bool (*g_PubKeyDecryptor)(const uint8_t* pData, FX_DWORD size, uint8_t* data_buf, FX_DWORD& data_len) = NULL;
+void CRYPT_SetPubKeyDecryptor(bool (*func)(const uint8_t* pData, FX_DWORD size, uint8_t* data_buf, FX_DWORD& data_len))
{
g_PubKeyDecryptor = func;
}
diff --git a/core/src/fdrm/crypto/fx_crypt_aes.cpp b/core/src/fdrm/crypto/fx_crypt_aes.cpp
index 4bd87105aa..9f142226da 100644
--- a/core/src/fdrm/crypto/fx_crypt_aes.cpp
+++ b/core/src/fdrm/crypto/fx_crypt_aes.cpp
@@ -988,7 +988,7 @@ static void aes_encrypt_cbc(unsigned char *dest, const unsigned char *src, int l
}
FXSYS_memcpy(ctx->iv, iv, sizeof(iv));
}
-void CRYPT_AESSetKey(void* context, FX_DWORD blocklen, const uint8_t* key, FX_DWORD keylen, FX_BOOL bEncrypt)
+void CRYPT_AESSetKey(void* context, FX_DWORD blocklen, const uint8_t* key, FX_DWORD keylen, bool bEncrypt)
{
aes_setup((AESContext*)context, blocklen, key, keylen);
}
diff --git a/core/src/fdrm/crypto/fx_crypt_sha.cpp b/core/src/fdrm/crypto/fx_crypt_sha.cpp
index b22348a03c..de1ec08d3d 100644
--- a/core/src/fdrm/crypto/fx_crypt_sha.cpp
+++ b/core/src/fdrm/crypto/fx_crypt_sha.cpp
@@ -405,7 +405,7 @@ uint64_t FX_ato64i(const FX_CHAR* str)
} else if (str[i] >= 'A' && str[i] <= 'F') {
ret |= (str[i] - 'A' + 10) & 0xFF;
} else {
- FXSYS_assert(FALSE);
+ FXSYS_assert(false);
}
}
return ret;