summaryrefslogtreecommitdiff
path: root/source/pdf/pdf-crypt.c
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2016-06-14 17:06:50 +0100
committerRobin Watts <robin.watts@artifex.com>2016-06-17 13:24:47 +0100
commit4a4e6adae4c1a0e9ab3b6fad477edfe26c1a2aca (patch)
tree4ed45be7545229ce5d8bb124a8332b5444004b1b /source/pdf/pdf-crypt.c
parentc9bad4ef3e32bc799b134bc3b258f9392cf60e3e (diff)
downloadmupdf-4a4e6adae4c1a0e9ab3b6fad477edfe26c1a2aca.tar.xz
Use 'size_t' instead of int as appropriate.
This silences the many warnings we get when building for x64 in windows. This does not address any of the warnings we get in thirdparty libraries - in particular harfbuzz. These look (at a quick glance) harmless though.
Diffstat (limited to 'source/pdf/pdf-crypt.c')
-rw-r--r--source/pdf/pdf-crypt.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/source/pdf/pdf-crypt.c b/source/pdf/pdf-crypt.c
index bff6510f..d9c34d7f 100644
--- a/source/pdf/pdf-crypt.c
+++ b/source/pdf/pdf-crypt.c
@@ -353,7 +353,7 @@ static const unsigned char padding[32] =
};
static void
-pdf_compute_encryption_key(fz_context *ctx, pdf_crypt *crypt, unsigned char *password, int pwlen, unsigned char *key)
+pdf_compute_encryption_key(fz_context *ctx, pdf_crypt *crypt, unsigned char *password, size_t pwlen, unsigned char *key)
{
unsigned char buf[32];
unsigned int p;
@@ -422,7 +422,7 @@ pdf_compute_encryption_key(fz_context *ctx, pdf_crypt *crypt, unsigned char *pas
*/
static void
-pdf_compute_encryption_key_r5(fz_context *ctx, pdf_crypt *crypt, unsigned char *password, int pwlen, int ownerkey, unsigned char *validationkey)
+pdf_compute_encryption_key_r5(fz_context *ctx, pdf_crypt *crypt, unsigned char *password, size_t pwlen, int ownerkey, unsigned char *validationkey)
{
unsigned char buffer[128 + 8 + 48];
fz_sha256 sha256;
@@ -477,12 +477,12 @@ pdf_compute_encryption_key_r5(fz_context *ctx, pdf_crypt *crypt, unsigned char *
*/
static void
-pdf_compute_hardened_hash_r6(fz_context *ctx, unsigned char *password, int pwlen, unsigned char salt[16], unsigned char *ownerkey, unsigned char hash[32])
+pdf_compute_hardened_hash_r6(fz_context *ctx, unsigned char *password, size_t pwlen, unsigned char salt[16], unsigned char *ownerkey, unsigned char hash[32])
{
unsigned char data[(128 + 64 + 48) * 64];
unsigned char block[64];
int block_size = 32;
- int data_len = 0;
+ size_t data_len = 0;
int i, j, sum;
fz_sha256 sha256;
@@ -545,7 +545,7 @@ pdf_compute_hardened_hash_r6(fz_context *ctx, unsigned char *password, int pwlen
}
static void
-pdf_compute_encryption_key_r6(fz_context *ctx, pdf_crypt *crypt, unsigned char *password, int pwlen, int ownerkey, unsigned char *validationkey)
+pdf_compute_encryption_key_r6(fz_context *ctx, pdf_crypt *crypt, unsigned char *password, size_t pwlen, int ownerkey, unsigned char *validationkey)
{
unsigned char hash[32];
unsigned char iv[16];
@@ -575,7 +575,7 @@ pdf_compute_encryption_key_r6(fz_context *ctx, pdf_crypt *crypt, unsigned char *
*/
static void
-pdf_compute_user_password(fz_context *ctx, pdf_crypt *crypt, unsigned char *password, int pwlen, unsigned char *output)
+pdf_compute_user_password(fz_context *ctx, pdf_crypt *crypt, unsigned char *password, size_t pwlen, unsigned char *output)
{
if (crypt->r == 2)
{
@@ -636,7 +636,7 @@ pdf_compute_user_password(fz_context *ctx, pdf_crypt *crypt, unsigned char *pass
*/
static int
-pdf_authenticate_user_password(fz_context *ctx, pdf_crypt *crypt, unsigned char *password, int pwlen)
+pdf_authenticate_user_password(fz_context *ctx, pdf_crypt *crypt, unsigned char *password, size_t pwlen)
{
unsigned char output[32];
pdf_compute_user_password(ctx, crypt, password, pwlen, output);
@@ -655,7 +655,7 @@ pdf_authenticate_user_password(fz_context *ctx, pdf_crypt *crypt, unsigned char
*/
static int
-pdf_authenticate_owner_password(fz_context *ctx, pdf_crypt *crypt, unsigned char *ownerpass, int pwlen)
+pdf_authenticate_owner_password(fz_context *ctx, pdf_crypt *crypt, unsigned char *ownerpass, size_t pwlen)
{
unsigned char pwbuf[32];
unsigned char key[32];