Browse Source

Allocates bigger hashData buffer

Yury Delendik 12 years ago
parent
commit
2b63cd7e62
  1. 3
      src/core/crypto.js
  2. 1
      test/pdfs/.gitignore
  3. BIN
      test/pdfs/bug900822.pdf
  4. 6
      test/test_manifest.json

3
src/core/crypto.js

@ -449,7 +449,8 @@ var CipherTransformFactory = (function CipherTransformFactoryClosure() { @@ -449,7 +449,8 @@ var CipherTransformFactory = (function CipherTransformFactoryClosure() {
function prepareKeyData(fileId, password, ownerPassword, userPassword,
flags, revision, keyLength, encryptMetadata) {
var hashData = new Uint8Array(100), i = 0, j, n;
var hashDataSize = 40 + ownerPassword.length + fileId.length;
var hashData = new Uint8Array(hashDataSize), i = 0, j, n;
if (password) {
n = Math.min(32, password.length);
for (; i < n; ++i)

1
test/pdfs/.gitignore vendored

@ -29,6 +29,7 @@ @@ -29,6 +29,7 @@
!freeculture.pdf
!pdfkit_compressed.pdf
!TAMReview.pdf
!bug900822.pdf
!issue918.pdf
!issue1905.pdf
!issue2833.pdf

BIN
test/pdfs/bug900822.pdf

Binary file not shown.

6
test/test_manifest.json

@ -1439,6 +1439,12 @@ @@ -1439,6 +1439,12 @@
"rounds": 1,
"type": "eq"
},
{ "id": "bug900822",
"file": "pdfs/bug900822.pdf",
"md5": "70e2a3c5922574eeda169c955cf9d084",
"rounds": 1,
"type": "load"
},
{ "id": "issue2853",
"file": "pdfs/issue2853.pdf",
"md5": "9f0ad95ef0b243ee8813c4eca0f7a042",

Loading…
Cancel
Save