1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2025-12-06 21:21:08 +01:00

Make StringUtils.randomString(int) use SecureRandom

This commit is contained in:
Florian Schmaus 2016-01-06 14:56:49 +01:00
parent f79a7d9d5f
commit 658a671cbe
6 changed files with 34 additions and 8 deletions

View file

@ -42,8 +42,8 @@ public class IntTestUtil {
public static UsernameAndPassword registerAccount(XMPPConnection connection)
throws NoResponseException, XMPPErrorException, NotConnectedException,
InterruptedException {
return registerAccount(connection, StringUtils.randomString(12),
StringUtils.randomString(12));
return registerAccount(connection, StringUtils.insecureRandomString(12),
StringUtils.insecureRandomString(12));
}
public static UsernameAndPassword registerAccount(XMPPConnection connection, String username,

View file

@ -519,7 +519,7 @@ public class SmackIntegrationTestFramework {
accountUsername = USERNAME_PREFIX + '-' + middlefix + '-' +testRunResult.testRunId;
}
if (StringUtils.isNullOrEmpty(accountPassword)) {
accountPassword = StringUtils.randomString(16);
accountPassword = StringUtils.insecureRandomString(16);
}
// @formatter:off
Builder builder = XMPPTCPConnectionConfiguration.builder()
@ -584,7 +584,7 @@ public class SmackIntegrationTestFramework {
}
public static final class TestRunResult {
public final String testRunId = StringUtils.randomString(5);
public final String testRunId = StringUtils.insecureRandomString(5);
private final List<SuccessfulTest> successfulTests = Collections.synchronizedList(new LinkedList<SuccessfulTest>());
private final List<FailedTest> failedIntegrationTests = Collections.synchronizedList(new LinkedList<FailedTest>());
private final List<TestNotPossible> impossibleTestMethods = Collections.synchronizedList(new LinkedList<TestNotPossible>());