From 69910d6463ef0d84913d15304cca2b851602418f Mon Sep 17 00:00:00 2001 From: Dalibor Topic Date: Mon, 30 May 2016 16:33:17 +0200 Subject: [PATCH 1/2] 8154469: Update FSF address Updated Free Software Foundation's mailing address in LICENSE Reviewed-by: rriggs, shade --- jdk/LICENSE | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/jdk/LICENSE b/jdk/LICENSE index b40a0f457d7..8b400c7ab81 100644 --- a/jdk/LICENSE +++ b/jdk/LICENSE @@ -3,7 +3,7 @@ The GNU General Public License (GPL) Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. -59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. @@ -287,8 +287,8 @@ pointer to where the full notice is found. more details. You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., 59 - Temple Place, Suite 330, Boston, MA 02111-1307 USA + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Also add information on how to contact you by electronic and paper mail. From 6c8b5e04acfeb0b20f4e2ff4a74eab238ad7003f Mon Sep 17 00:00:00 2001 From: Ivan Gerasimov Date: Mon, 30 May 2016 18:39:43 +0300 Subject: [PATCH 2/2] 8158111: Make handling of 3rd party providers more stable Reviewed-by: xuelei --- .../security/ssl/RSAClientKeyExchange.java | 34 +++++++++++++++++-- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/jdk/src/java.base/share/classes/sun/security/ssl/RSAClientKeyExchange.java b/jdk/src/java.base/share/classes/sun/security/ssl/RSAClientKeyExchange.java index 38a942d03b7..6cb2b650de5 100644 --- a/jdk/src/java.base/share/classes/sun/security/ssl/RSAClientKeyExchange.java +++ b/jdk/src/java.base/share/classes/sun/security/ssl/RSAClientKeyExchange.java @@ -90,6 +90,30 @@ final class RSAClientKeyExchange extends HandshakeMessage { } } + /* + * Retrieving the cipher's provider name for the debug purposes + * can throw an exception by itself. + */ + private static String safeProviderName(Cipher cipher) { + try { + return cipher.getProvider().toString(); + } catch (Exception e) { + if (debug != null && Debug.isOn("handshake")) { + System.out.println("Retrieving The Cipher provider name" + + " caused exception " + e.getMessage()); + } + } + try { + return cipher.toString() + " (provider name not available)"; + } catch (Exception e) { + if (debug != null && Debug.isOn("handshake")) { + System.out.println("Retrieving The Cipher name" + + " caused exception " + e.getMessage()); + } + } + return "(cipher/provider names not available)"; + } + /* * Server gets the PKCS #1 (block format 02) data, decrypts * it with its private key. @@ -132,15 +156,19 @@ final class RSAClientKeyExchange extends HandshakeMessage { cipher.getProvider().getName()); } catch (InvalidKeyException | UnsupportedOperationException iue) { if (debug != null && Debug.isOn("handshake")) { - System.out.println("The Cipher provider " + - cipher.getProvider().getName() + - " caused exception: " + iue.getMessage()); + System.out.println("The Cipher provider " + + safeProviderName(cipher) + + " caused exception: " + iue.getMessage()); } needFailover = true; } if (needFailover) { + // The cipher might be spoiled by unsuccessful call to init(), + // so request a fresh instance + cipher = JsseJce.getCipher(JsseJce.CIPHER_RSA_PKCS1); + // Use DECRYPT_MODE and dispose the previous initialization. cipher.init(Cipher.DECRYPT_MODE, privateKey); boolean failed = false;