diff options
author | Robin Watts <robin.watts@artifex.com> | 2011-11-15 18:37:21 +0000 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2011-11-17 18:32:05 +0000 |
commit | db360fac468dc89b45c89bd30374b61b27c221b1 (patch) | |
tree | fcc016479e4ba301fc5a66fac5cb8a2b45e29541 /pdf/pdf_crypt.c | |
parent | 37b1af3eeae78cfe312d81eb616d98158445cae6 (diff) | |
download | mupdf-db360fac468dc89b45c89bd30374b61b27c221b1.tar.xz |
AES encryption tweak; strings can be 0 bytes long
Do not emit a warning if AES strings are 0 bytes long.
Diffstat (limited to 'pdf/pdf_crypt.c')
-rw-r--r-- | pdf/pdf_crypt.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/pdf/pdf_crypt.c b/pdf/pdf_crypt.c index 4dd4c4e1..81ee5649 100644 --- a/pdf/pdf_crypt.c +++ b/pdf/pdf_crypt.c @@ -729,7 +729,11 @@ pdf_crypt_obj_imp(pdf_crypt *crypt, fz_obj *obj, unsigned char *key, int keylen) if (crypt->strf.method == PDF_CRYPT_AESV2 || crypt->strf.method == PDF_CRYPT_AESV3) { - if (n & 15 || n < 32) + if (n == 0) + { + /* Empty strings are permissible */ + } + else if (n & 15 || n < 32) fz_warn("invalid string length for aes encryption"); else { |