summaryrefslogtreecommitdiff
path: root/source/pdf/pdf-crypt.c
diff options
context:
space:
mode:
Diffstat (limited to 'source/pdf/pdf-crypt.c')
-rw-r--r--source/pdf/pdf-crypt.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/source/pdf/pdf-crypt.c b/source/pdf/pdf-crypt.c
index 850ab942..92a9e428 100644
--- a/source/pdf/pdf-crypt.c
+++ b/source/pdf/pdf-crypt.c
@@ -689,8 +689,8 @@ pdf_authenticate_owner_password(fz_context *ctx, pdf_crypt *crypt, unsigned char
memcpy(userpass, crypt->o, 32);
for (x = 0; x < 20; x++)
{
- for (i = 0; i < n; i++)
- xor[i] = key[i] ^ (19 - x);
+ for (i = 0; i < 32; i++)
+ xor[i] = pwbuf[i] ^ (19 - x);
fz_arc4_init(&arc4, xor, n);
fz_arc4_encrypt(&arc4, userpass, userpass, 32);
}