Looks good Ivan. Given that we know that the cipher transformation is RSA/ECB/PKCS1Padding, maybe you can consider printing that in the exception. As a result, maybe something like :

+ System.out.println("Retrieval of RSA/ECB/PKCS1Padding cipher transformation" +
+                         " provider caused exception " + e.getMessage());

The cipher.toString() call might be unnecessary as a result then. Will leave that up to you/Xuelei.

You might want to consider marking the bug public.

Regards,
Sean.

On 30/05/16 10:14, Xuelei Fan wrote:
Looks fine to me.  Thanks!

Xuelei

On 5/30/2016 4:48 PM, Ivan Gerasimov wrote:
Hello!

In the file
src/java.base/share/classes/sun/security/ssl/RSAClientKeyExchange.java:

When doing the debug printing:
                     System.out.println("The Cipher provider " +
                         cipher.getProvider().getName() +
                         " caused exception: " + iue.getMessage());

cipher.getProvider() may throw an exception, which will cause the
fail-over branch get skipped.


Furthermore, in the fail-over branch it is better to re-acquire an
instance of the cipher, as the previous call to init() might have left
the current instance in inconsistent state.

Would you please help review the proposed fix?

BUGURL: https://bugs.openjdk.java.net/browse/JDK-8158111
WEBREV: http://cr.openjdk.java.net/~igerasim/8158111/00/webrev/


With kind regards,
Ivan



Reply via email to