From dd976db1cb65fb31d1d2a8a04d53dd0264c79f56 Mon Sep 17 00:00:00 2001 From: Sam Hartman Date: Fri, 20 Jun 2003 16:47:04 +0000 Subject: [PATCH] Split out etype_info2 decoder from etype_info decoder. In the etype_info decoder ignore Heimdal's tag 2. Ticket: 1619 Tags: pullup git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@15638 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/krb5/asn.1/ChangeLog | 13 +++++++++++++ src/lib/krb5/asn.1/asn1_k_decode.c | 26 +++++++++++++++++++++++++- src/lib/krb5/asn.1/asn1_k_decode.h | 4 ++-- src/lib/krb5/asn.1/krb5_decode.c | 2 +- 4 files changed, 41 insertions(+), 4 deletions(-) diff --git a/src/lib/krb5/asn.1/ChangeLog b/src/lib/krb5/asn.1/ChangeLog index ebb31f673..44fbaed07 100644 --- a/src/lib/krb5/asn.1/ChangeLog +++ b/src/lib/krb5/asn.1/ChangeLog @@ -1,3 +1,16 @@ +2003-06-20 Sam Hartman + + * asn1_k_decode.h (asn1_decode_etype_info2): Prototype. Also + deleted prototype for asn1_decode_etype_info_entry as that is not + used outside asn1_k_decode.c + + * krb5_decode.c (decode_krb5_etype_info2): Call etype_info2 decoder + + * asn1_k_decode.c (asn1_decode_etype_info_entry): Split out + etype_info2 and etype_info decoder so we ignore tag 2 in the + heimdal encoder + (asn1_decode_etype_info2): new function + 2003-05-23 Sam Hartman * asn1_k_decode.c (asn1_decode_etype_info_entry): Fix logic error diff --git a/src/lib/krb5/asn.1/asn1_k_decode.c b/src/lib/krb5/asn.1/asn1_k_decode.c index 6da26dd17..147c455bd 100644 --- a/src/lib/krb5/asn.1/asn1_k_decode.c +++ b/src/lib/krb5/asn.1/asn1_k_decode.c @@ -807,7 +807,7 @@ asn1_error_code asn1_decode_sequence_of_checksum(asn1buf *buf, krb5_checksum *** decode_array_body(krb5_checksum, asn1_decode_checksum); } -asn1_error_code asn1_decode_etype_info_entry(asn1buf *buf, krb5_etype_info_entry *val ) +static asn1_error_code asn1_decode_etype_info2_entry(asn1buf *buf, krb5_etype_info_entry *val ) { setup(); { begin_structure(); @@ -832,12 +832,36 @@ asn1_error_code asn1_decode_etype_info_entry(asn1buf *buf, krb5_etype_info_entry } cleanup(); } +static asn1_error_code asn1_decode_etype_info_entry(asn1buf *buf, krb5_etype_info_entry *val ) +{ + setup(); + { begin_structure(); + get_field(val->etype,0,asn1_decode_enctype); + if (tagnum == 1) { + get_lenfield(val->length,val->salt,1,asn1_decode_octetstring); + } else { + val->length = KRB5_ETYPE_NO_SALT; + val->salt = 0; + } + val->s2kparams.data = NULL; + val->s2kparams.length = 0; + + end_structure(); + val->magic = KV5M_ETYPE_INFO_ENTRY; + } + cleanup(); +} asn1_error_code asn1_decode_etype_info(asn1buf *buf, krb5_etype_info_entry ***val ) { decode_array_body(krb5_etype_info_entry,asn1_decode_etype_info_entry); } +asn1_error_code asn1_decode_etype_info2(asn1buf *buf, krb5_etype_info_entry ***val ) +{ + decode_array_body(krb5_etype_info_entry,asn1_decode_etype_info2_entry); +} + asn1_error_code asn1_decode_passwdsequence(asn1buf *buf, passwd_phrase_element *val) { setup(); diff --git a/src/lib/krb5/asn.1/asn1_k_decode.h b/src/lib/krb5/asn.1/asn1_k_decode.h index e2639dda3..ebcbe935b 100644 --- a/src/lib/krb5/asn.1/asn1_k_decode.h +++ b/src/lib/krb5/asn.1/asn1_k_decode.h @@ -141,8 +141,6 @@ asn1_error_code asn1_decode_pa_data (asn1buf *buf, krb5_pa_data *val); asn1_error_code asn1_decode_passwdsequence (asn1buf *buf, passwd_phrase_element *val); -asn1_error_code asn1_decode_etype_info_entry - (asn1buf *buf, krb5_etype_info_entry *val); asn1_error_code asn1_decode_sam_challenge (asn1buf *buf, krb5_sam_challenge *val); asn1_error_code asn1_decode_sam_challenge_2 @@ -187,6 +185,8 @@ asn1_error_code asn1_decode_sequence_of_passwdsequence asn1_error_code asn1_decode_etype_info (asn1buf *buf, krb5_etype_info_entry ***val); +asn1_error_code asn1_decode_etype_info2 + (asn1buf *buf, krb5_etype_info_entry ***val); #endif diff --git a/src/lib/krb5/asn.1/krb5_decode.c b/src/lib/krb5/asn.1/krb5_decode.c index 1ca57e930..3d2a6a709 100644 --- a/src/lib/krb5/asn.1/krb5_decode.c +++ b/src/lib/krb5/asn.1/krb5_decode.c @@ -748,7 +748,7 @@ krb5_error_code decode_krb5_etype_info2(const krb5_data *code, krb5_etype_info_e { setup_buf_only(); *rep = 0; - retval = asn1_decode_etype_info(&buf,rep); + retval = asn1_decode_etype_info2(&buf,rep); if(retval) clean_return(retval); cleanup_none(); /* we're not allocating anything here */ } -- 2.26.2