--- old/src/jdk.crypto.ec/share/classes/sun/security/ec/XDHKeyAgreement.java 2018-08-30 11:09:24.985608001 -0400 +++ new/src/jdk.crypto.ec/share/classes/sun/security/ec/XDHKeyAgreement.java 2018-08-30 11:09:24.081608001 -0400 @@ -38,8 +38,11 @@ import javax.crypto.KeyAgreementSpi; import javax.crypto.SecretKey; import javax.crypto.ShortBufferException; +import javax.crypto.spec.SecretKeySpec; import java.util.function.Function; +import sun.security.util.XECParameters; + public class XDHKeyAgreement extends KeyAgreementSpi { private byte[] privateKey; @@ -202,7 +205,14 @@ throws IllegalStateException, NoSuchAlgorithmException, InvalidKeyException { - throw new NoSuchAlgorithmException("Not supported"); + if (algorithm == null) { + throw new NoSuchAlgorithmException("Algorithm must not be null"); + } + if (!(algorithm.equals("TlsPremasterSecret"))) { + throw new NoSuchAlgorithmException + ("Only supported for algorithm TlsPremasterSecret"); + } + return new SecretKeySpec(engineGenerateSecret(), "TlsPremasterSecret"); } static class X25519 extends XDHKeyAgreement {