Skip to content

Commit

Permalink
Potential fix for code scanning alert no. 115: Insecure randomness
Browse files Browse the repository at this point in the history
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
  • Loading branch information
robfrank and github-advanced-security[bot] authored Jan 16, 2025
1 parent b863ebb commit 04c9c62
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import java.io.*;
import java.net.*;
import java.security.*;
import java.security.SecureRandom;

public class SocketFactory {
private javax.net.SocketFactory socketFactory;
Expand Down Expand Up @@ -85,6 +86,7 @@ protected SSLContext createSSLContext() {
final KeyManagerFactory kmf = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());

final KeyStore keyStore = KeyStore.getInstance(keyStoreType);
final SecureRandom secureRandom = new SecureRandom();

Check warning on line 89 in network/src/main/java/com/arcadedb/network/binary/SocketFactory.java

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

network/src/main/java/com/arcadedb/network/binary/SocketFactory.java#L89

Avoid unused local variables such as 'secureRandom'.
final char[] keyStorePass = keyStorePassword.toCharArray();
keyStore.load(getAsStream(keyStorePath), keyStorePass);

Expand Down

0 comments on commit 04c9c62

Please sign in to comment.