* get_in_tkt.c (krb5_get_in_tkt): also check for the version
authorMark Eichin <eichin@mit.edu>
Sat, 4 Feb 1995 00:00:13 +0000 (00:00 +0000)
committerMark Eichin <eichin@mit.edu>
Sat, 4 Feb 1995 00:00:13 +0000 (00:00 +0000)
number of the reply being whatever we had in the first byte of the
request.

tested with kinit.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@4910 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/krb5/krb/ChangeLog
src/lib/krb5/krb/get_in_tkt.c

index c3083e89a0c8d5449fb970eff8b7e534d2a1c55d..4cf6e21841e8f735a83f1773b02adba213bc3d67 100644 (file)
@@ -1,3 +1,9 @@
+Fri Feb  3 16:41:19 1995  Mark Eichin  (eichin@cygnus.com)
+
+       * get_in_tkt.c (krb5_get_in_tkt): also check for the version
+       number of the reply being whatever we had in the first byte of the
+       request.
+
 Fri Feb  3 08:07:55 1995  Theodore Y. Ts'o  (tytso@dcl)
 
        * compat_recv.c (krb_v4_recvauth): Use explicit 32 bit types so
index b29820714fc34e10220f08771ca3e8d6d8e19aaf..8cc5ae99e06907a3e4945b7ef33c4b0850d792e1 100644 (file)
@@ -103,6 +103,7 @@ krb5_get_in_tkt(context, options, addrs, pre_auth_type, etype, keytype,
     krb5_enctype etypes[1];
     krb5_timestamp time_now;
     krb5_pa_data       *padata;
+    char k4_version;           /* same type as *(krb5_data::data) */
 
     if (! krb5_realm_compare(context, creds->client, creds->server))
        return KRB5_IN_TKT_REALM_MISMATCH;
@@ -177,6 +178,7 @@ krb5_get_in_tkt(context, options, addrs, pre_auth_type, etype, keytype,
     if (retval = encode_krb5_as_req(&request, &packet))
        goto cleanup;
 
+    k4_version = packet->data[0];
     retval = krb5_sendto_kdc(context, packet, 
                             krb5_princ_realm(context, creds->client), &reply);
     krb5_free_data(context, packet);
@@ -218,8 +220,9 @@ krb5_get_in_tkt(context, options, addrs, pre_auth_type, etype, keytype,
        t_switch = reply.data[1];
        t_switch &= ~1;
 
-       if (reply.data[0] == V4_KRB_PROT_VERSION
-           && t_switch == V4_AUTH_MSG_ERR_REPLY) {
+       if (t_switch == V4_AUTH_MSG_ERR_REPLY
+           && (reply.data[0] == V4_KRB_PROT_VERSION
+               || reply.data[0] == k4_version)) {
            retval = KRB5KRB_AP_ERR_V4_REPLY;
        } else {
            retval = KRB5KRB_AP_ERR_MSG_TYPE;