mirror of
https://github.com/mozilla/pdf.js.git
synced 2026-07-25 08:27:19 +02:00
Merge pull request #21581 from Snuffleupagus/createCipherTransform-rm-AES256Cipher-duplication
Reduce duplication in `CipherTransformFactory.prototype.createCipherTransform`
This commit is contained in:
commit
244fb9e822
@ -1280,7 +1280,7 @@ class CipherTransformFactory {
|
||||
PasswordResponses.NEED_PASSWORD
|
||||
);
|
||||
}
|
||||
if (this.algorithm === 5) {
|
||||
if (this.algorithm === 5 || cfm.name === "AESV3") {
|
||||
// V=5 always uses 256-bit AES with the file encryption key, even
|
||||
// when a producer wrongly sets the crypt filter's CFM to AESV2
|
||||
// (bug 2046659).
|
||||
@ -1308,9 +1308,6 @@ class CipherTransformFactory {
|
||||
)
|
||||
);
|
||||
}
|
||||
if (cfm.name === "AESV3") {
|
||||
return AES256Cipher.bind(null, this.encryptionKey);
|
||||
}
|
||||
throw new FormatError("Unknown crypto method");
|
||||
};
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user