Author: ay
Date: Fri Nov 30 14:09:47 2012
New Revision: 1415640
URL: http://svn.apache.org/viewvc?rev=1415640&view=rev
Log:
Merged revisions 1415618 via svn merge from
https://svn.apache.org/repos/asf/cxf/trunk
........
r1415618 | ay | 2012-11-30 14:17:46 +0100 (Fri, 30 Nov 2012) | 1 line
some addition and minor improvent to CXF-4596
........
Modified:
cxf/branches/2.6.x-fixes/ (props changed)
cxf/branches/2.6.x-fixes/api/src/main/java/org/apache/cxf/io/CachedOutputStream.java
Propchange: cxf/branches/2.6.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.
Modified:
cxf/branches/2.6.x-fixes/api/src/main/java/org/apache/cxf/io/CachedOutputStream.java
URL:
http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/api/src/main/java/org/apache/cxf/io/CachedOutputStream.java?rev=1415640&r1=1415639&r2=1415640&view=diff
==============================================================================
---
cxf/branches/2.6.x-fixes/api/src/main/java/org/apache/cxf/io/CachedOutputStream.java
(original)
+++
cxf/branches/2.6.x-fixes/api/src/main/java/org/apache/cxf/io/CachedOutputStream.java
Fri Nov 30 14:09:47 2012
@@ -19,6 +19,7 @@
package org.apache.cxf.io;
+import java.io.BufferedOutputStream;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
@@ -34,6 +35,7 @@ import java.io.PipedOutputStream;
import java.io.Reader;
import java.security.GeneralSecurityException;
import java.security.Key;
+import java.security.SecureRandom;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
@@ -92,7 +94,6 @@ public class CachedOutputStream extends
private String cipherTransformation = defaultCipherTransformation;
private Cipher enccipher;
private Cipher deccipher;
-
private List<CachedOutputStreamCallback> callbacks;
@@ -614,7 +615,9 @@ public class CachedOutputStream extends
a = cipherTransformation;
}
try {
- Key key = KeyGenerator.getInstance(a).generateKey();
+ KeyGenerator keygen = KeyGenerator.getInstance(a);
+ keygen.init(new SecureRandom());
+ Key key = keygen.generateKey();
enccipher = Cipher.getInstance(cipherTransformation);
deccipher = Cipher.getInstance(cipherTransformation);
enccipher.init(Cipher.ENCRYPT_MODE, key);
@@ -629,7 +632,7 @@ public class CachedOutputStream extends
}
private OutputStream createOutputStream(File file) throws IOException {
- OutputStream out = new FileOutputStream(file);
+ OutputStream out = new BufferedOutputStream(new
FileOutputStream(file));
if (cipherTransformation != null) {
try {
initCiphers();