poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kiwiwi...@apache.org
Subject svn commit: r1654716 - /poi/trunk/src/java/org/apache/poi/poifs/crypt/standard/StandardEncryptionInfoBuilder.java
Date Mon, 26 Jan 2015 00:02:20 GMT
Author: kiwiwings
Date: Mon Jan 26 00:02:20 2015
New Revision: 1654716

URL: http://svn.apache.org/r1654716
Log:
The default for standard encryption cipher algorithm was wrongly set to rc4

Modified:
    poi/trunk/src/java/org/apache/poi/poifs/crypt/standard/StandardEncryptionInfoBuilder.java

Modified: poi/trunk/src/java/org/apache/poi/poifs/crypt/standard/StandardEncryptionInfoBuilder.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/poifs/crypt/standard/StandardEncryptionInfoBuilder.java?rev=1654716&r1=1654715&r2=1654716&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/poifs/crypt/standard/StandardEncryptionInfoBuilder.java
(original)
+++ poi/trunk/src/java/org/apache/poi/poifs/crypt/standard/StandardEncryptionInfoBuilder.java
Mon Jan 26 00:02:20 2015
@@ -57,8 +57,14 @@ public class StandardEncryptionInfoBuild
         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;
         }



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org


Mime
View raw message