mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-23 08:38:06 +02:00
Merge pull request #19555 from rossj/master
Pad rev 4 encryption keys to be >= 16 bytes (issue 19484)
This commit is contained in:
commit
aa70b28365
5 changed files with 26 additions and 1 deletions
|
@ -1787,7 +1787,14 @@ class CipherTransformFactory {
|
|||
);
|
||||
}
|
||||
|
||||
this.encryptionKey = encryptionKey;
|
||||
if (algorithm === 4 && encryptionKey.length < 16) {
|
||||
// Extend key to 16 byte minimum (undocumented),
|
||||
// fixes issue19484_1.pdf and issue19484_2.pdf.
|
||||
this.encryptionKey = new Uint8Array(16);
|
||||
this.encryptionKey.set(encryptionKey);
|
||||
} else {
|
||||
this.encryptionKey = encryptionKey;
|
||||
}
|
||||
|
||||
if (algorithm >= 4) {
|
||||
const cf = dict.get("CF");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue