summaryrefslogtreecommitdiff
path: root/source/luametatex/source/libraries/pplib
diff options
context:
space:
mode:
Diffstat (limited to 'source/luametatex/source/libraries/pplib')
-rw-r--r--source/luametatex/source/libraries/pplib/ppapi.h2
-rw-r--r--source/luametatex/source/libraries/pplib/ppcrypt.c7
-rw-r--r--source/luametatex/source/libraries/pplib/ppcrypt.h1
-rw-r--r--source/luametatex/source/libraries/pplib/readme.txt6
4 files changed, 10 insertions, 6 deletions
diff --git a/source/luametatex/source/libraries/pplib/ppapi.h b/source/luametatex/source/libraries/pplib/ppapi.h
index e9ced5718..56137f8f2 100644
--- a/source/luametatex/source/libraries/pplib/ppapi.h
+++ b/source/luametatex/source/libraries/pplib/ppapi.h
@@ -8,7 +8,7 @@
#include "ppconf.h"
-#define pplib_version "v2.1"
+#define pplib_version "v2.2"
#define pplib_author "p.jackowski@gust.org.pl"
/* types */
diff --git a/source/luametatex/source/libraries/pplib/ppcrypt.c b/source/luametatex/source/libraries/pplib/ppcrypt.c
index ce63e7cab..832e8c327 100644
--- a/source/luametatex/source/libraries/pplib/ppcrypt.c
+++ b/source/luametatex/source/libraries/pplib/ppcrypt.c
@@ -137,7 +137,7 @@ static int ppcrypt_password_encoding (uint8_t *password, size_t *passwordlength)
{
uint8_t *p, newpassword[PPCRYPT_MAX_PASSWORD], *n;
const uint8_t *e;
- uint32_t unicode;
+ uint32_t unicode = 0;
for (n = &newpassword[0], p = &password[0], e = p + *passwordlength; p < e; ++n)
{
@@ -398,7 +398,10 @@ static ppcrypt_status ppcrypt_authenticate_permissions (ppcrypt *crypt, ppstring
aes_decode_data(perms->data, perms->size, permsdata, crypt->filekey, crypt->filekeylength, nulliv, AES_NULL_PADDING);
if (permsdata[9] != 'a' || permsdata[10] != 'd' || permsdata[11] != 'b')
- return PPCRYPT_FAIL;
+ { /* if we get here, the password hash is correct, we don't need to fail because of unreadable perms (found such docs) */
+ crypt->flags |= PPCRYPT_UNREADABLE_PERMISSIONS;
+ return PPCRYPT_DONE;
+ }
/* do not check/update permissions flags here; they might be different inside crypt string */
if (0)
diff --git a/source/luametatex/source/libraries/pplib/ppcrypt.h b/source/luametatex/source/libraries/pplib/ppcrypt.h
index 9fa52d878..a7131adbb 100644
--- a/source/luametatex/source/libraries/pplib/ppcrypt.h
+++ b/source/luametatex/source/libraries/pplib/ppcrypt.h
@@ -46,6 +46,7 @@ typedef struct {
#define PPCRYPT_STRING_RC4 (1<<4)
#define PPCRYPT_STREAM_AES (1<<5)
#define PPCRYPT_STRING_AES (1<<6)
+#define PPCRYPT_UNREADABLE_PERMISSIONS (1<<7)
#define PPCRYPT_STREAM (PPCRYPT_STREAM_AES|PPCRYPT_STREAM_RC4)
#define PPCRYPT_STRING (PPCRYPT_STRING_AES|PPCRYPT_STRING_RC4)
diff --git a/source/luametatex/source/libraries/pplib/readme.txt b/source/luametatex/source/libraries/pplib/readme.txt
index ee5d141dc..550367a28 100644
--- a/source/luametatex/source/libraries/pplib/readme.txt
+++ b/source/luametatex/source/libraries/pplib/readme.txt
@@ -1,3 +1,3 @@
-This is (to be) added to util/utilflate.c:
-
-# include "../../utilities/auxzlib.h"
+This is (to be) added to util/utilflate.c:
+
+# include "../../utilities/auxzlib.h"