Encoding and Decoding in the asn1_k_encode/decode.c files

sriram karthikeyan sriram.karthikeyan at gmail.com
Tue Apr 25 17:19:18 EDT 2006


hi,
iam a final year undergrad student frm India, iam currently working on
my Btech project which involves performing specific modifications to
the Kerberos protocol to test for performance. In the process of
modification we have added certain new fields to the existing data
structure. But are facing errors while encoding the new modified
messages. for example

****old ticket data structure*******
typedef struct _krb5_ticket {
    krb5_magic magic;
    /* cleartext portion */
    krb5_principal server;              /* server name/realm */
    krb5_enc_data enc_part;             /* encryption type, kvno, encrypted
                                           encoding */
    krb5_enc_tkt_part *enc_part2;       /* ptr to decrypted version, if
                                           available */

} krb5_ticket;
**********************************************************
******new ticket data structure******

typedef struct _krb5_ticket {
    krb5_magic magic;
    /* cleartext portion */
    krb5_principal server;              /* server name/realm */
    krb5_enc_data enc_part;             /* encryption type, kvno, encrypted
                                           encoding */
    krb5_enc_tkt_part *enc_part2;       /* ptr to decrypted version, if
                                           available */
    krb5_hash_data hash_part;           /* encryption type, kvno, encrypted
                                           encoding */
    krb5_hash_tkt_part *enc_part3;      /* ptr to decrypted version, if
                                           available */
} krb5_ticket;
***********************************************

but we face an error ASN1_MISSING FIELD while encoding/decoding the
newly added field of ticket...
*******************asn1_k_decode.c*****************************
asn1_error_code asn1_decode_ticket(asn1buf *buf, krb5_ticket *val)
{
  setup();
  unsigned int applen;
  apptag(1);
  { begin_structure();
    { krb5_kvno vno;
      get_field(vno,0,asn1_decode_kvno);
      if(vno != KVNO) return KRB5KDC_ERR_BAD_PVNO; }
    alloc_field(val->server,krb5_principal_data);
    get_field(val->server,1,asn1_decode_realm);
    get_field(val->server,2,asn1_decode_principal_name);
    get_field(val->enc_part,3,asn1_decode_encrypted_data);
    get_field(val->hash_part,4,asn1_decode_hashed_data);  ///newly
inserted code that returns
                                                                      
                 the error/////
    end_structure();
    val->magic = KV5M_TICKET;
  }
  if (!applen) {
      taginfo t;
      retval = asn1_get_tag_2(buf, &t);
      if (retval) return retval;
  }
  cleanup();
}
***************************************************************************


would be very grateful if someone cud help us




More information about the Kerberos mailing list