From: Theodore Tso Date: Wed, 8 Nov 1995 07:45:12 +0000 (+0000) Subject: * krb5_decode.c (decode_krb5_pa_enc_ts, decode_krb5_enc_data): Added X-Git-Tag: krb5-1.0-beta6~846 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=588adc05e5b8bb2787c1462df37ece48d7eb2176;p=krb5.git * krb5_decode.c (decode_krb5_pa_enc_ts, decode_krb5_enc_data): Added new functions. * krb5_encode.c (encode_krb5_pa_enc_ts, encode_krb5_enc_data): Added new functions. KRB5-asn.py (PA-ENC-TS-ENC): Added new definition for the krb5_pa_enc_ts structure. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@7053 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/krb5/asn.1/ChangeLog b/src/lib/krb5/asn.1/ChangeLog index af163884f..8ddcdbe17 100644 --- a/src/lib/krb5/asn.1/ChangeLog +++ b/src/lib/krb5/asn.1/ChangeLog @@ -1,3 +1,14 @@ +Tue Oct 31 20:06:49 1995 Theodore Y. Ts'o + + * krb5_decode.c (decode_krb5_pa_enc_ts, decode_krb5_enc_data): + Added new functions. + + * krb5_encode.c (encode_krb5_pa_enc_ts, encode_krb5_enc_data): + Added new functions. + + * KRB5-asn.py (PA-ENC-TS-ENC): Added new definition for the + krb5_pa_enc_ts structure. + Fri Oct 6 22:03:01 1995 Theodore Y. Ts'o * Makefile.in: Remove ##DOS!include of config/windows.in. diff --git a/src/lib/krb5/asn.1/KRB5-asn.py b/src/lib/krb5/asn.1/KRB5-asn.py index 989a214fe..036d10dee 100644 --- a/src/lib/krb5/asn.1/KRB5-asn.py +++ b/src/lib/krb5/asn.1/KRB5-asn.py @@ -329,6 +329,11 @@ ETYPE-INFO-ENTRY ::= SEQUENCE { ETYPE-INFO ::= SEQUENCE OF ETYPE-INFO-ENTRY +PA-ENC-TS-ENC ::= SEQUENCE { + patimestamp[0] KerberosTime, -- client's time + pausec[1] INTEGER OPTIONAL +} + -- These ASN.1 definitions are NOT part of the official Kerberos protocol... -- New ASN.1 definitions for the kadmin protocol. diff --git a/src/lib/krb5/asn.1/krb5_decode.c b/src/lib/krb5/asn.1/krb5_decode.c index 63d4bd941..71d8c60ae 100644 --- a/src/lib/krb5/asn.1/krb5_decode.c +++ b/src/lib/krb5/asn.1/krb5_decode.c @@ -727,6 +727,32 @@ krb5_error_code decode_krb5_etype_info(code, rep) cleanup_none(); /* we're not allocating anything here */ } - - - +krb5_error_code decode_krb5_enc_data(code, rep) + const krb5_data * code; + krb5_enc_data ** rep; +{ + setup_buf_only(); + alloc_field(*rep,krb5_enc_data); + + retval = asn1_decode_encrypted_data(&buf,*rep); + if(retval) clean_return(retval); + + cleanup(free); +} + +krb5_error_code decode_krb5_pa_enc_ts(code, rep) + const krb5_data * code; + krb5_pa_enc_ts ** rep; +{ + setup(); + alloc_field(*rep,krb5_pa_enc_ts); + { begin_structure(); + get_field((*rep)->patimestamp,0,asn1_decode_kerberos_time); + if (tagnum == 1) { + get_field((*rep)->pausec,1,asn1_decode_int); + } else + (*rep)->pausec = 0; + end_structure (); } + cleanup(free); +} + diff --git a/src/lib/krb5/asn.1/krb5_encode.c b/src/lib/krb5/asn.1/krb5_encode.c index 3411c898d..2a9d7a923 100644 --- a/src/lib/krb5/asn.1/krb5_encode.c +++ b/src/lib/krb5/asn.1/krb5_encode.c @@ -725,6 +725,37 @@ krb5_error_code encode_krb5_etype_info( rep, code) krb5_cleanup(); } +krb5_error_code encode_krb5_enc_data(rep, code) + const krb5_enc_data * rep; + krb5_data ** code; +{ + krb5_setup(); + + retval = asn1_encode_encrypted_data(buf,rep,&length); + if(retval) return retval; + sum += length; + + krb5_cleanup(); +} + +krb5_error_code encode_krb5_pa_enc_ts(rep, code) + const krb5_pa_enc_ts * rep; + krb5_data ** code; +{ + krb5_setup(); + + /* pausec[1] INTEGER OPTIONAL */ + if (rep->pausec) + krb5_addfield(rep->pausec,1,asn1_encode_integer); + + /* patimestamp[0] KerberosTime, -- client's time */ + krb5_addfield(rep->patimestamp,0,asn1_encode_kerberos_time); + + krb5_makeseq(); + + krb5_cleanup(); +} + /* Sandia Additions */ krb5_error_code encode_krb5_pwd_sequence( rep, code) const passwd_phrase_element * rep;