You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2021/02/15 07:03:25 UTC
[camel] branch master updated (13159b6 -> f3b688c)
This is an automated email from the ASF dual-hosted git repository.
acosentino pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git.
from 13159b6 CAMEL-16193 - Use SecureRandom instead of Random - Camel-Consul
new e377399 CAMEL-16193 - Use SecureRandom instead of Random - Camel-Ehcache
new f3b688c CAMEL-16193 - Use SecureRandom instead of Random - Camel-FTP
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../java/org/apache/camel/component/ehcache/EhcacheTestSupport.java | 4 ++--
.../camel/component/file/remote/FtpConsumerAsyncStressTest.java | 4 ++--
.../camel/component/file/remote/FtpProducerMoveExistingTest.java | 4 ++--
3 files changed, 6 insertions(+), 6 deletions(-)
[camel] 01/02: CAMEL-16193 - Use SecureRandom instead of Random -
Camel-Ehcache
Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
acosentino pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git
commit e377399fd1f52fdf7557b55135c12e92921946ce
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Mon Feb 15 07:59:06 2021 +0100
CAMEL-16193 - Use SecureRandom instead of Random - Camel-Ehcache
---
.../java/org/apache/camel/component/ehcache/EhcacheTestSupport.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/components/camel-ehcache/src/test/java/org/apache/camel/component/ehcache/EhcacheTestSupport.java b/components/camel-ehcache/src/test/java/org/apache/camel/component/ehcache/EhcacheTestSupport.java
index fb98aab..5dcf672 100644
--- a/components/camel-ehcache/src/test/java/org/apache/camel/component/ehcache/EhcacheTestSupport.java
+++ b/components/camel-ehcache/src/test/java/org/apache/camel/component/ehcache/EhcacheTestSupport.java
@@ -17,10 +17,10 @@
package org.apache.camel.component.ehcache;
import java.net.URL;
+import java.security.SecureRandom;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
-import java.util.Random;
import java.util.UUID;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
@@ -90,7 +90,7 @@ public class EhcacheTestSupport extends CamelTestSupport {
}
protected static int[] generateRandomArrayOfInt(int size, int lower, int upper) {
- Random random = new Random();
+ SecureRandom random = new SecureRandom();
int[] array = new int[size];
Arrays.setAll(array, i -> random.nextInt(upper - lower) + lower);
[camel] 02/02: CAMEL-16193 - Use SecureRandom instead of Random -
Camel-FTP
Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
acosentino pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git
commit f3b688c76ff9ac60c91884e053e2ca134f41774a
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Mon Feb 15 08:02:50 2021 +0100
CAMEL-16193 - Use SecureRandom instead of Random - Camel-FTP
---
.../camel/component/file/remote/FtpConsumerAsyncStressTest.java | 4 ++--
.../camel/component/file/remote/FtpProducerMoveExistingTest.java | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpConsumerAsyncStressTest.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpConsumerAsyncStressTest.java
index 5e74774..6dcf57c 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpConsumerAsyncStressTest.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpConsumerAsyncStressTest.java
@@ -16,7 +16,7 @@
*/
package org.apache.camel.component.file.remote;
-import java.util.Random;
+import java.security.SecureRandom;
import org.apache.camel.Exchange;
import org.apache.camel.Processor;
@@ -65,7 +65,7 @@ public class FtpConsumerAsyncStressTest extends FtpServerTestSupport {
from(getFtpUrl()).threads(10).process(new Processor() {
public void process(Exchange exchange) throws Exception {
// simulate some work with random time to complete
- Random ran = new Random();
+ SecureRandom ran = new SecureRandom();
int delay = ran.nextInt(500) + 10;
Thread.sleep(delay);
}
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpProducerMoveExistingTest.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpProducerMoveExistingTest.java
index 0275732..57b732e 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpProducerMoveExistingTest.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpProducerMoveExistingTest.java
@@ -18,9 +18,9 @@ package org.apache.camel.component.file.remote;
import java.io.File;
import java.io.FilenameFilter;
+import java.security.SecureRandom;
import java.text.SimpleDateFormat;
import java.util.Date;
-import java.util.Random;
import org.apache.camel.CamelExecutionException;
import org.apache.camel.Exchange;
@@ -249,7 +249,7 @@ public class FtpProducerMoveExistingTest extends FtpServerTestSupport {
private String generateRandomString(int targetStringLength) {
int leftLimit = 97; // letter 'a'
int rightLimit = 122; // letter 'z'
- Random random = new Random();
+ SecureRandom random = new SecureRandom();
StringBuilder buffer = new StringBuilder(targetStringLength);
for (int i = 0; i < targetStringLength; i++) {
int randomLimitedInt = leftLimit + (int) (random.nextFloat() * (rightLimit - leftLimit + 1));