# HG changeset patch # User xuelei # Date 1529640848 25200 # Node ID 76025c6c6e29adee49aaeeb51d0e1cbf8e172173 # Parent 85305a50b1b49c34fd5724f6781bf4627dbdfacd Update on SSLKeyExchange.java and more diff -r 85305a50b1b4 -r 76025c6c6e29 src/java.base/share/classes/sun/security/ssl/RSAServerKeyExchange.java --- a/src/java.base/share/classes/sun/security/ssl/RSAServerKeyExchange.java Thu Jun 21 10:15:41 2018 +0800 +++ b/src/java.base/share/classes/sun/security/ssl/RSAServerKeyExchange.java Thu Jun 21 21:14:08 2018 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -216,9 +216,6 @@ */ private static final class RSAServerKeyExchangeProducer implements HandshakeProducer { - static final RSAServerKeyExchangeProducer INSTANCE = - new RSAServerKeyExchangeProducer(); - // Prevent instantiation of this class. private RSAServerKeyExchangeProducer() { // blank @@ -306,7 +303,7 @@ // // validate // - // check constraints of EC PublicKey + // check constraints of RSA PublicKey RSAPublicKey publicKey; try { KeyFactory kf = JsseJce.getKeyFactory("RSA"); diff -r 85305a50b1b4 -r 76025c6c6e29 src/java.base/share/classes/sun/security/ssl/SSLKeyExchange.java --- a/src/java.base/share/classes/sun/security/ssl/SSLKeyExchange.java Thu Jun 21 10:15:41 2018 +0800 +++ b/src/java.base/share/classes/sun/security/ssl/SSLKeyExchange.java Thu Jun 21 21:14:08 2018 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -37,7 +37,8 @@ import sun.security.ssl.SupportedGroupsExtension.SupportedGroups; import sun.security.ssl.X509Authentication.X509Possession; -final class SSLKeyExchange implements SSLKeyAgreement { +final class SSLKeyExchange implements SSLKeyAgreementGenerator, + SSLHandshakeBinding { private final SSLAuthentication authentication; private final SSLKeyAgreement keyAgreement; @@ -104,14 +105,6 @@ } @Override - public SSLPossession createPossession(HandshakeContext handshakeContext) { - // Please call createPossessions() so that the SSLAuthentication - // is counted. - throw new UnsupportedOperationException( - "SSLKeyExchange.createPossessions() should be used instead"); - } - - @Override public SSLKeyDerivation createKeyDerivation( HandshakeContext handshakeContext) throws IOException { return keyAgreement.createKeyDerivation(handshakeContext); diff -r 85305a50b1b4 -r 76025c6c6e29 src/java.base/share/classes/sun/security/ssl/ServerKeyExchange.java --- a/src/java.base/share/classes/sun/security/ssl/ServerKeyExchange.java Thu Jun 21 10:15:41 2018 +0800 +++ b/src/java.base/share/classes/sun/security/ssl/ServerKeyExchange.java Thu Jun 21 21:14:08 2018 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -86,7 +86,7 @@ @Override public void consume(ConnectionContext context, ByteBuffer message) throws IOException { - // The producing happens in client side only. + // The consuming happens in client side only. ClientHandshakeContext chc = (ClientHandshakeContext)context; // clean up this consumer @@ -104,7 +104,7 @@ } } - // not consumer defined. + // no consumer defined. chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, "Unexpected ServerKeyExchange handshake message."); } diff -r 85305a50b1b4 -r 76025c6c6e29 src/java.base/share/classes/sun/security/ssl/X509Authentication.java --- a/src/java.base/share/classes/sun/security/ssl/X509Authentication.java Thu Jun 21 10:15:41 2018 +0800 +++ b/src/java.base/share/classes/sun/security/ssl/X509Authentication.java Thu Jun 21 21:14:08 2018 -0700 @@ -171,8 +171,8 @@ X509Certificate[] clientCerts = km.getCertificateChain(clientAlias); if ((clientCerts == null) || (clientCerts.length == 0)) { if (SSLLogger.isOn && SSLLogger.isOn("ssl")) { - SSLLogger.finest( - clientAlias + " is not a certificate entry"); + SSLLogger.finest(clientAlias + + " is a private key entry with no cert chain stored"); } return null; }