--- old/src/java.base/share/classes/sun/security/internal/spec/TlsMasterSecretParameterSpec.java 2017-10-06 17:48:34.199247716 -0300 +++ new/src/java.base/share/classes/sun/security/internal/spec/TlsMasterSecretParameterSpec.java 2017-10-06 17:48:34.101247774 -0300 @@ -47,7 +47,7 @@ private final SecretKey premasterSecret; private final int majorVersion, minorVersion; - private final byte[] clientRandom, serverRandom; + private final byte[] clientRandom, serverRandom, extendedMasterSecretSessionHash; private final String prfHashAlg; private final int prfHashLength; private final int prfBlockSize; @@ -64,6 +64,7 @@ * @param minorVersion the minor number of the protocol version * @param clientRandom the client's random value * @param serverRandom the server's random value + * @param extendedMasterSecretSessionHash the session hash for Extended Master Secret * @param prfHashAlg the name of the TLS PRF hash algorithm to use. * Used only for TLS 1.2+. TLS1.1 and earlier use a fixed PRF. * @param prfHashLength the output length of the TLS PRF hash algorithm. @@ -79,6 +80,7 @@ public TlsMasterSecretParameterSpec(SecretKey premasterSecret, int majorVersion, int minorVersion, byte[] clientRandom, byte[] serverRandom, + byte[] extendedMasterSecretSessionHash, String prfHashAlg, int prfHashLength, int prfBlockSize) { if (premasterSecret == null) { throw new NullPointerException("premasterSecret must not be null"); @@ -88,6 +90,9 @@ this.minorVersion = checkVersion(minorVersion); this.clientRandom = clientRandom.clone(); this.serverRandom = serverRandom.clone(); + this.extendedMasterSecretSessionHash = + (extendedMasterSecretSessionHash != null ? + extendedMasterSecretSessionHash.clone() : null); this.prfHashAlg = prfHashAlg; this.prfHashLength = prfHashLength; this.prfBlockSize = prfBlockSize; @@ -147,6 +152,17 @@ } /** + * Returns a copy of the Extended Master Secret session hash. + * + * @return a copy of the Extended Master Secret session hash. + */ + public byte[] getExtendedMasterSecretSessionHash() { + return (extendedMasterSecretSessionHash != null ? + extendedMasterSecretSessionHash.clone() : + null); + } + + /** * Obtains the PRF hash algorithm to use in the PRF calculation. * * @return the hash algorithm.