8215524: Finished message validation failure should be decrypt_error alert
authorjjiang
Tue, 26 Feb 2019 07:26:29 +0800
changeset 53916 ca1a2ca32885
parent 53915 7fec83061f24
child 53917 1ee9149df76f
8215524: Finished message validation failure should be decrypt_error alert Reviewed-by: xuelei
src/java.base/share/classes/sun/security/ssl/Finished.java
--- a/src/java.base/share/classes/sun/security/ssl/Finished.java	Mon Feb 25 14:45:29 2019 -0800
+++ b/src/java.base/share/classes/sun/security/ssl/Finished.java	Tue Feb 26 07:26:29 2019 +0800
@@ -102,7 +102,7 @@
             }
 
             if (m.remaining() != verifyDataLen) {
-                throw context.conContext.fatal(Alert.ILLEGAL_PARAMETER,
+                throw context.conContext.fatal(Alert.DECODE_ERROR,
                     "Inappropriate finished message: need " + verifyDataLen +
                     " but remaining " + m.remaining() + " bytes verify_data");
             }
@@ -120,7 +120,7 @@
                         "Failed to generate verify_data", ioe);
             }
             if (!MessageDigest.isEqual(myVerifyData, verifyData)) {
-                throw context.conContext.fatal(Alert.ILLEGAL_PARAMETER,
+                throw context.conContext.fatal(Alert.DECRYPT_ERROR,
                         "The Finished message cannot be verified.");
             }
         }