mirror of https://github.com/apache/poi.git
The default for standard encryption cipher algorithm was wrongly set to rc4
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1654716 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
0bd3a6df26
commit
3d97978cee
|
@ -57,8 +57,14 @@ public class StandardEncryptionInfoBuilder implements EncryptionInfoBuilder {
|
|||
this.info = info;
|
||||
|
||||
if (cipherAlgorithm == null) {
|
||||
cipherAlgorithm = CipherAlgorithm.rc4;
|
||||
cipherAlgorithm = CipherAlgorithm.aes128;
|
||||
}
|
||||
if (cipherAlgorithm != CipherAlgorithm.aes128 &&
|
||||
cipherAlgorithm != CipherAlgorithm.aes192 &&
|
||||
cipherAlgorithm != CipherAlgorithm.aes256) {
|
||||
throw new EncryptedDocumentException("Standard encryption only supports AES128/192/256.");
|
||||
}
|
||||
|
||||
if (hashAlgorithm == null) {
|
||||
hashAlgorithm = HashAlgorithm.sha1;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue