From 48e45f229b76c32de88004fd0f34310a839df36d Mon Sep 17 00:00:00 2001 From: Mark Eichin Date: Fri, 3 Feb 1995 01:58:30 +0000 Subject: [PATCH] * get_in_tkt.c (krb5_get_in_tkt): if krb5_is_as_rep fails, check if the packet might be a V4 error packet. Use modified V4 check so that it compiles under SCO. simple, but untested. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@4880 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/krb5/krb/ChangeLog | 8 +++++++- src/lib/krb5/krb/get_in_tkt.c | 19 ++++++++++++++++++- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/src/lib/krb5/krb/ChangeLog b/src/lib/krb5/krb/ChangeLog index c389925da..8b107835e 100644 --- a/src/lib/krb5/krb/ChangeLog +++ b/src/lib/krb5/krb/ChangeLog @@ -1,3 +1,9 @@ +Thu Feb 2 20:51:55 1995 Mark Eichin (eichin@cygnus.com) + + * get_in_tkt.c (krb5_get_in_tkt): if krb5_is_as_rep fails, check + if the packet might be a V4 error packet. Use modified V4 check so + that it compiles under SCO. + Mon Jan 30 15:46:14 1995 Chris Provenzano (proven@mit.edu) * int-proto.h Update prototypes for krb5_get_cred_via_tgt(), and @@ -47,7 +53,7 @@ Wed Jan 25 16:54:40 1995 Chris Provenzano (proven@mit.edu) Fri Jan 13 15:23:47 1995 Chris Provenzano (proven@mit.edu) - * Added krb5_context to all krb5_routines + * Added krb5_context to all krb5_routines Mon Dec 19 21:55:44 1994 Theodore Y. Ts'o (tytso@dcl) diff --git a/src/lib/krb5/krb/get_in_tkt.c b/src/lib/krb5/krb/get_in_tkt.c index de17523ce..966ee31e2 100644 --- a/src/lib/krb5/krb/get_in_tkt.c +++ b/src/lib/krb5/krb/get_in_tkt.c @@ -206,7 +206,24 @@ krb5_get_in_tkt(context, options, addrs, pre_auth_type, etype, keytype, } if (!krb5_is_as_rep(&reply)) { - retval = KRB5KRB_AP_ERR_MSG_TYPE; +/* these are in as well but it isn't worth including. */ +#define V4_KRB_PROT_VERSION 4 +#define V4_AUTH_MSG_ERR_REPLY (5<<1) + /* check here for V4 reply */ + unsigned int t_switch; + + /* From v4 g_in_tkt.c: This used to be + switch (pkt_msg_type(rpkt) & ~1) { + but SCO 3.2v4 cc compiled that incorrectly. */ + t_switch = reply.data[1] + t_switch &= ~1; + + if (reply.data[0] == V4_KRB_PROT_VERSION + && t_switch == V4_AUTH_MSG_ERR_REPLY) { + retval = KRB5KRB_AP_ERR_V4_REPLY; + } else { + retval = KRB5KRB_AP_ERR_MSG_TYPE; + } goto cleanup; } if (retval = decode_krb5_as_rep(&reply, &as_reply)) -- 2.26.2