changeset 428:dafef320b7e5

6958060: Malformed AP-REQ crashes acceptor side Reviewed-by: valeriep, xuelei
author weijun
date Thu, 17 Jun 2010 12:41:06 +0800
parents 9a2c6c57caa1
children d5a9ad8ea905
files src/share/classes/sun/security/jgss/krb5/InitialToken.java
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/sun/security/jgss/krb5/InitialToken.java	Thu Jun 17 12:41:00 2010 +0800
+++ b/src/share/classes/sun/security/jgss/krb5/InitialToken.java	Thu Jun 17 12:41:06 2010 +0800
@@ -209,6 +209,12 @@
 
             int pos = 0;
 
+            if (checksum == null) {
+                GSSException ge = new GSSException(GSSException.FAILURE, -1,
+                        "No cksum in AP_REQ's authenticator");
+                ge.initCause(new KrbException(Krb5.KRB_AP_ERR_INAPP_CKSUM));
+                throw ge;
+            }
             checksumBytes = checksum.getBytes();
 
             if ((checksumBytes[0] != CHECKSUM_FIRST_BYTES[0]) ||