Skip to content

Commit

Permalink
Check dhParameters is set before using
Browse files Browse the repository at this point in the history
  • Loading branch information
peterdettman committed Sep 16, 2013
1 parent 7a452ef commit 4cae61d
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,11 @@ public byte[] generateServerKeyExchange() throws IOException

if (this.keyExchange == KeyExchangeAlgorithm.DHE_PSK)
{
if (this.dhParameters == null)
{
throw new TlsFatalAlert(AlertDescription.internal_error);
}

this.dhAgreePrivateKey = TlsDHUtils.generateEphemeralServerKeyExchange(context.getSecureRandom(),
this.dhParameters, buf);
}
Expand Down

0 comments on commit 4cae61d

Please sign in to comment.