From e112be17d7dacfd24e8adebaeafd25b26259c804 Mon Sep 17 00:00:00 2001 From: Ezra Peisach Date: Wed, 13 Mar 1996 18:08:23 +0000 Subject: [PATCH] * krb5_decode.c (decode_krb5_ticket, decode_krb5_enc_tkt_part, decode_krb5_authenticator, decode_krb5_error, decode_krb5_ap_req, decode_krb5_ap_rep, decode_krb5_ap_rep_enc_part, decode_krb5_safe, decode_krb5_priv, decode_krb5_enc_priv_part, decode_krb5_cred, decode_krb5_enc_part): Add magic values. * asn1_k_decode.c (asn1_decode_passwdsequence): Set magic values in structures. (asn1_decode_kdc_req_body): Set magic in authorization_data if not sent OTW. I believe all magic number fields now being properly initialized in the asn.1 layer. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@7619 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/krb5/asn.1/ChangeLog | 14 ++++++++++++++ src/lib/krb5/asn.1/asn1_k_decode.c | 5 ++++- src/lib/krb5/asn.1/krb5_decode.c | 13 +++++++++++++ 3 files changed, 31 insertions(+), 1 deletion(-) diff --git a/src/lib/krb5/asn.1/ChangeLog b/src/lib/krb5/asn.1/ChangeLog index 9aba1388c..b4e161ff4 100644 --- a/src/lib/krb5/asn.1/ChangeLog +++ b/src/lib/krb5/asn.1/ChangeLog @@ -1,3 +1,17 @@ +Wed Mar 13 12:52:32 1996 Ezra Peisach + + * krb5_decode.c (decode_krb5_ticket, decode_krb5_enc_tkt_part, + decode_krb5_authenticator, decode_krb5_error, + decode_krb5_ap_req, decode_krb5_ap_rep, + decode_krb5_ap_rep_enc_part, decode_krb5_safe, + decode_krb5_priv, decode_krb5_enc_priv_part, + decode_krb5_cred, decode_krb5_enc_part): Add magic values. + + * asn1_k_decode.c (asn1_decode_passwdsequence): Set magic values + in structures. + (asn1_decode_kdc_req_body): Set magic in + authorization_data if not sent OTW. + Tue Feb 27 19:23:55 1996 Theodore Y. Ts'o * krb5_decode.c (decode_krb5_enc_tkt_part): If starttime is not diff --git a/src/lib/krb5/asn.1/asn1_k_decode.c b/src/lib/krb5/asn.1/asn1_k_decode.c index ff985fbf5..dac9a4c79 100644 --- a/src/lib/krb5/asn.1/asn1_k_decode.c +++ b/src/lib/krb5/asn.1/asn1_k_decode.c @@ -414,7 +414,7 @@ asn1_error_code asn1_decode_kdc_req_body(buf, val) if(tagnum == 10){ get_field(val->authorization_data,10,asn1_decode_encrypted_data); } else{ - val->authorization_data.magic = 0; + val->authorization_data.magic = KV5M_ENC_DATA; val->authorization_data.enctype = 0; val->authorization_data.kvno = 0; val->authorization_data.ciphertext.data = NULL; @@ -690,10 +690,13 @@ asn1_error_code asn1_decode_passwdsequence(buf, val) alloc_field(val->passwd,krb5_data); get_lenfield(val->passwd->length,val->passwd->data, 0,asn1_decode_charstring); + val->passwd->magic = KV5M_DATA; alloc_field(val->phrase,krb5_data); get_lenfield(val->phrase->length,val->phrase->data, 1,asn1_decode_charstring); + val->phrase->magic = KV5M_DATA; end_structure(); + val->magic = KV5M_PASSWD_PHRASE_ELEMENT; } cleanup(); } diff --git a/src/lib/krb5/asn.1/krb5_decode.c b/src/lib/krb5/asn.1/krb5_decode.c index 318a403a4..2cc15ce4e 100644 --- a/src/lib/krb5/asn.1/krb5_decode.c +++ b/src/lib/krb5/asn.1/krb5_decode.c @@ -180,6 +180,7 @@ krb5_error_code decode_krb5_authenticator(code, rep) opt_field(*((*rep)->subkey),6,asn1_decode_encryption_key); opt_field((*rep)->seq_number,7,asn1_decode_int32); opt_field((*rep)->authorization_data,8,asn1_decode_authorization_data); + (*rep)->magic = KV5M_AUTHENTICATOR; end_structure(); } cleanup_manual(); @@ -211,6 +212,7 @@ krb5_error_code decode_krb5_ticket(code, rep) get_field((*rep)->server,1,asn1_decode_realm); get_field((*rep)->server,2,asn1_decode_principal_name); get_field((*rep)->enc_part,3,asn1_decode_encrypted_data); + (*rep)->magic = KV5M_TICKET; end_structure(); } cleanup_manual(); @@ -264,6 +266,7 @@ krb5_error_code decode_krb5_enc_tkt_part(code, rep) 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(); @@ -355,6 +358,7 @@ krb5_error_code decode_krb5_ap_req(code, rep) get_field(*((*rep)->ticket),3,asn1_decode_ticket); get_field((*rep)->authenticator,4,asn1_decode_encrypted_data); end_structure(); + (*rep)->magic = KV5M_AP_REQ; } cleanup_manual(); error_out: @@ -385,6 +389,7 @@ krb5_error_code decode_krb5_ap_rep(code, rep) } get_field((*rep)->enc_part,2,asn1_decode_encrypted_data); end_structure(); + (*rep)->magic = KV5M_AP_REP; } cleanup(free); } @@ -405,6 +410,7 @@ krb5_error_code decode_krb5_ap_rep_enc_part(code, rep) opt_field(*((*rep)->subkey),2,asn1_decode_encryption_key); opt_field((*rep)->seq_number,3,asn1_decode_int32); end_structure(); + (*rep)->magic = KV5M_AP_REP_ENC_PART; } cleanup_manual(); error_out: @@ -484,6 +490,7 @@ krb5_error_code decode_krb5_safe(code, rep) get_field(**rep,2,asn1_decode_krb_safe_body); alloc_field((*rep)->checksum,krb5_checksum); get_field(*((*rep)->checksum),3,asn1_decode_checksum); + (*rep)->magic = KV5M_SAFE; end_structure(); } cleanup_manual(); @@ -514,6 +521,7 @@ krb5_error_code decode_krb5_priv(code, rep) #endif } get_field((*rep)->enc_part,3,asn1_decode_encrypted_data); + (*rep)->magic = KV5M_PRIV; end_structure(); } cleanup(free); @@ -538,6 +546,7 @@ krb5_error_code decode_krb5_enc_priv_part(code, rep) get_field(*((*rep)->s_address),4,asn1_decode_host_address); if(tagnum == 5){ alloc_field((*rep)->r_address,krb5_address); } opt_field(*((*rep)->r_address),5,asn1_decode_host_address); + (*rep)->magic = KV5M_PRIV_ENC_PART; end_structure(); } cleanup_manual(); @@ -570,6 +579,7 @@ krb5_error_code decode_krb5_cred(code, rep) } get_field((*rep)->tickets,2,asn1_decode_sequence_of_ticket); get_field((*rep)->enc_part,3,asn1_decode_encrypted_data); + (*rep)->magic = KV5M_CRED; end_structure(); } cleanup(free); @@ -594,6 +604,7 @@ krb5_error_code decode_krb5_enc_cred_part(code, rep) opt_field(*((*rep)->s_address),4,asn1_decode_host_address); if(tagnum == 5){ alloc_field((*rep)->r_address,krb5_address); } opt_field(*((*rep)->r_address),5,asn1_decode_host_address); + (*rep)->magic = KV5M_CRED_ENC_PART; end_structure(); } cleanup_manual(); @@ -640,6 +651,7 @@ krb5_error_code decode_krb5_error(code, rep) get_field((*rep)->server,10,asn1_decode_principal_name); opt_lenfield((*rep)->text.length,(*rep)->text.data,11,asn1_decode_generalstring); opt_lenfield((*rep)->e_data.length,(*rep)->e_data.data,12,asn1_decode_charstring); + (*rep)->magic = KV5M_ERROR; end_structure(); } cleanup_manual(); @@ -683,6 +695,7 @@ krb5_error_code decode_krb5_pwd_data(code, rep) { begin_structure(); get_field((*rep)->sequence_count,0,asn1_decode_int); get_field((*rep)->element,1,asn1_decode_sequence_of_passwdsequence); + (*rep)->magic = KV5M_PWD_DATA; end_structure (); } cleanup(free); } -- 2.26.2