Save challenge for later
This commit is contained in:
parent
64a12a816f
commit
6666494009
@ -41,6 +41,7 @@ public class MessageClient implements IMessageClient, Runnable {
|
||||
private BufferedReader dmapIn;
|
||||
|
||||
private Cipher aesCipher;
|
||||
private byte[] challenge;
|
||||
|
||||
/**
|
||||
* Creates a new client instance.
|
||||
@ -160,9 +161,9 @@ public class MessageClient implements IMessageClient, Runnable {
|
||||
private byte[] generateChallenge(PublicKey serverPublicKey) {
|
||||
SecureRandom secureRandom = new SecureRandom();
|
||||
// Generate new random 32 byte challenge
|
||||
byte[] clearTextChallenge = new byte[32];
|
||||
secureRandom.nextBytes(clearTextChallenge);
|
||||
return clearTextChallenge;
|
||||
this.challenge = new byte[32];
|
||||
secureRandom.nextBytes(this.challenge);
|
||||
return this.challenge;
|
||||
}
|
||||
|
||||
private String generateChallengeMessage(PublicKey serverPublicKey) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user