Fixed incomplete agreement

This commit is contained in:
Marcin Kostrzewski 2020-11-16 12:22:26 +01:00
parent f2cea164ae
commit 71c2a48a1f

View File

@ -65,6 +65,9 @@ public class DHExchange {
agreement.init(keyPair.getPrivate());
thisPublicKey = keyPair.getPublic();
agreement.doPhase(otherPublicKey, true);
generateSecret();
} catch (NoSuchAlgorithmException | InvalidKeySpecException | InvalidAlgorithmParameterException | InvalidKeyException e) {
e.printStackTrace();
@ -80,6 +83,7 @@ public class DHExchange {
logger.log(Level.INFO, "Agreement phase...");
agreement.doPhase(otherPublicKey, true);
generateSecret();
} catch (NoSuchAlgorithmException | InvalidKeySpecException | InvalidKeyException e) {
e.printStackTrace();
}