[1921] in Kerberos-V5-bugs

home help back first fref pref prev next nref lref last post

Re: kdc clockskew

daemon@ATHENA.MIT.EDU (Mark Eichin)
Mon May 13 11:39:30 1996

To: basch@lehman.com (Richard Basch)
Cc: krb5-bugs@MIT.EDU, raeburn@cygnus.com
From: Mark Eichin <eichin@cygnus.com>
Date: 13 May 1996 11:37:50 -0400
In-Reply-To: basch@lehman.com's message of Mon, 13 May 1996 08:48:07 -0400

Umm, hasn't this change made it to the MIT tree yet:

Thu May  2 21:59:23 1996  Mark Eichin  <eichin@cygnus.com>

	* krb5_decode.c (decode_krb5_enc_tkt_part): use tagnum correctly
	to handle optional starttime (previous code *always* replaced
	starttime with authtime.)

Note the if (tagnum...) expression. The original MIT code checked it
*after* the field was optionally read; this meant that it was always
already set to 7, regardless of whether or not it had been
parsed. This version makes it clear what we're doing in the optional
case, and has the virtue of *working* with postdated tickets...


krb5_error_code decode_krb5_enc_tkt_part(code, rep)
     const krb5_data * code;
     krb5_enc_tkt_part ** rep;
{
  setup();
  alloc_field(*rep,krb5_enc_tkt_part);
  clear_field(rep,session);
  clear_field(rep,client);

  check_apptag(3);
  { begin_structure();
    get_field((*rep)->flags,0,asn1_decode_ticket_flags);
    alloc_field((*rep)->session,krb5_keyblock);
    get_field(*((*rep)->session),1,asn1_decode_encryption_key);
    alloc_field((*rep)->client,krb5_principal_data);
    get_field((*rep)->client,2,asn1_decode_realm);
    get_field((*rep)->client,3,asn1_decode_principal_name);
    get_field((*rep)->transited,4,asn1_decode_transited_encoding);
    get_field((*rep)->times.authtime,5,asn1_decode_kerberos_time);
    if (tagnum == 6)
      { get_field((*rep)->times.starttime,6,asn1_decode_kerberos_time); }
    else
      (*rep)->times.starttime=(*rep)->times.authtime;
    get_field((*rep)->times.endtime,7,asn1_decode_kerberos_time);
    opt_field((*rep)->times.renew_till,8,asn1_decode_kerberos_time);
    opt_field((*rep)->caddrs,9,asn1_decode_host_addresses);
    opt_field((*rep)->authorization_data,10,asn1_decode_authorization_data);
    (*rep)->magic = KV5M_ENC_TKT_PART;
    end_structure();
  }
  cleanup_manual();
error_out:
  if (rep && *rep) {
      free_field(*rep,session);
      free_field(*rep,client);
      free(*rep);
  }
  return retval;
}

home help back first fref pref prev next nref lref last post