]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Split out etype_info2 decoder from etype_info decoder. In the
authorSam Hartman <hartmans@mit.edu>
Fri, 20 Jun 2003 16:47:04 +0000 (16:47 +0000)
committerSam Hartman <hartmans@mit.edu>
Fri, 20 Jun 2003 16:47:04 +0000 (16:47 +0000)
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
src/lib/krb5/asn.1/asn1_k_decode.c
src/lib/krb5/asn.1/asn1_k_decode.h
src/lib/krb5/asn.1/krb5_decode.c

index ebb31f6733712f8d122c9312cf93cf8e571d176e..44fbaed07eff562b0c49b5ccd1772aa8954d6b64 100644 (file)
@@ -1,3 +1,16 @@
+2003-06-20  Sam Hartman  <hartmans@mit.edu>
+
+       * 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  <hartmans@mit.edu>
 
        * asn1_k_decode.c (asn1_decode_etype_info_entry): Fix logic error
index 6da26dd176e17129dc759258ff04cb14d6d67316..147c455bd724446e6c927fc3322e0e2b2de1d08e 100644 (file)
@@ -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();
index e2639dda3b214c56caf97bd5fd216c39b98eaa65..ebcbe935b50f16f553d3960572665f33434bf4ef 100644 (file)
@@ -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
index 1ca57e93084f05d85f1bc383a0b915021573a3f4..3d2a6a7096c06bebf0e223c28cce88f01b26fde4 100644 (file)
@@ -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 */
 }