summaryrefslogtreecommitdiff
path: root/smcc/src/main
diff options
context:
space:
mode:
authortkellner <tkellner@8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4>2012-01-27 15:26:49 +0000
committertkellner <tkellner@8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4>2012-01-27 15:26:49 +0000
commit111d7e2bb3c4fbfed8b448633d3e8c1c6e5661db (patch)
tree869522926767e1ec6697cb18212dfa77e1e397cc /smcc/src/main
parentf3d213f55047482124eb2488ca49d56b050d1071 (diff)
downloadmocca-111d7e2bb3c4fbfed8b448633d3e8c1c6e5661db.tar.gz
mocca-111d7e2bb3c4fbfed8b448633d3e8c1c6e5661db.tar.bz2
mocca-111d7e2bb3c4fbfed8b448633d3e8c1c6e5661db.zip
Replace (important) instances of Random with SecureRandom
git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@1023 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4
Diffstat (limited to 'smcc/src/main')
-rw-r--r--smcc/src/main/java/at/gv/egiz/smcc/DNIeCryptoUtil.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/smcc/src/main/java/at/gv/egiz/smcc/DNIeCryptoUtil.java b/smcc/src/main/java/at/gv/egiz/smcc/DNIeCryptoUtil.java
index c4e27d08..75095c10 100644
--- a/smcc/src/main/java/at/gv/egiz/smcc/DNIeCryptoUtil.java
+++ b/smcc/src/main/java/at/gv/egiz/smcc/DNIeCryptoUtil.java
@@ -32,6 +32,7 @@ import java.security.InvalidKeyException;
import java.security.Key;
import java.security.KeyFactory;
import java.security.MessageDigest;
+import java.security.SecureRandom;
import java.security.NoSuchAlgorithmException;
import java.security.NoSuchProviderException;
import java.security.cert.CertificateFactory;
@@ -42,7 +43,6 @@ import java.security.spec.KeySpec;
import java.security.spec.RSAPrivateKeySpec;
import java.security.spec.RSAPublicKeySpec;
import java.util.Arrays;
-import java.util.Random;
import javax.crypto.BadPaddingException;
import javax.crypto.Cipher;
@@ -122,7 +122,7 @@ public class DNIeCryptoUtil {
for (int i = 0; i < length; i++) {
- Random rand = new Random();
+ SecureRandom rand = new SecureRandom();
byte current = (byte) rand.nextInt(255);
result[i] = current;
}