Fixed incomplete agreement
This commit is contained in:
parent
f2cea164ae
commit
71c2a48a1f
@ -65,6 +65,9 @@ public class DHExchange {
|
|||||||
agreement.init(keyPair.getPrivate());
|
agreement.init(keyPair.getPrivate());
|
||||||
|
|
||||||
thisPublicKey = keyPair.getPublic();
|
thisPublicKey = keyPair.getPublic();
|
||||||
|
agreement.doPhase(otherPublicKey, true);
|
||||||
|
|
||||||
|
generateSecret();
|
||||||
|
|
||||||
} catch (NoSuchAlgorithmException | InvalidKeySpecException | InvalidAlgorithmParameterException | InvalidKeyException e) {
|
} catch (NoSuchAlgorithmException | InvalidKeySpecException | InvalidAlgorithmParameterException | InvalidKeyException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
@ -80,6 +83,7 @@ public class DHExchange {
|
|||||||
logger.log(Level.INFO, "Agreement phase...");
|
logger.log(Level.INFO, "Agreement phase...");
|
||||||
agreement.doPhase(otherPublicKey, true);
|
agreement.doPhase(otherPublicKey, true);
|
||||||
|
|
||||||
|
generateSecret();
|
||||||
} catch (NoSuchAlgorithmException | InvalidKeySpecException | InvalidKeyException e) {
|
} catch (NoSuchAlgorithmException | InvalidKeySpecException | InvalidKeyException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user