Simplify asn1_decode_kdc_dh_key_info
authorGreg Hudson <ghudson@mit.edu>
Tue, 10 Jan 2012 07:33:41 +0000 (07:33 +0000)
committerGreg Hudson <ghudson@mit.edu>
Tue, 10 Jan 2012 07:33:41 +0000 (07:33 +0000)
Due to some lingering confusion, the last commit changing
asn1_decode_kdc_dh_key_info was correct but overly complicated (and
contained an incorrect comment).  Change it to just use get_lenfield
for subjectPublicKey.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25634 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/krb5/asn.1/asn1_k_decode.c

index e0c827c4f1829dc9ec4a6d8a3caee1e58c17c6b3..8df166a5a55b94bee2e2b97c477fbd334ed7b875 100644 (file)
@@ -1515,12 +1515,8 @@ asn1_decode_kdc_dh_key_info(asn1buf *buf, krb5_kdc_dh_key_info *val)
     setup();
     val->subjectPublicKey.data = NULL;
     { begin_structure();
-        /* Special handling for [0] IMPLICIT BIT STRING */
-        error_if_bad_tag(0);
-        if (asn1class != CONTEXT_SPECIFIC || construction != CONSTRUCTED)
-            clean_return(ASN1_BAD_ID);
-        get_lenfield_body(val->subjectPublicKey.length,
-                          val->subjectPublicKey.data, asn1_decode_bitstring);
+        get_lenfield(val->subjectPublicKey.length, val->subjectPublicKey.data,
+                     0, asn1_decode_bitstring);
         get_field(val->nonce, 1, asn1_decode_int32);
         opt_field(val->dhKeyExpiration, 2, asn1_decode_kerberos_time, 0);
         end_structure();