From 9f23e1a8133c11bff4ef5f41cb44d28041320a76 Mon Sep 17 00:00:00 2001 From: Greg Hudson Date: Sat, 11 Feb 2012 23:25:25 +0000 Subject: Data-driven ASN.1 decoder Add a general ASN.1 decoder implementation in asn1_encode.c using the same data structures as the encoder (augmented where necessary), and use it to define decoder functions in asn1_k_encode.c. Add a boolean type to atype_info, as it is needed for the pa_pac_req decoder. For the moment, just #if out the old decoder functions; they and their support code can be cleaned up later after a a few remaining utility functions are addressed. Changes to encoder and decoder interfaces are minimized, but there are two small ones. ldap_seqof_key_data has a kvno field added, and some of the decoder logic is pushed up into the caller. The safe_with_body decoder now outputs an allocated krb5_data * instead of a krb5_data with aliases into the input buffer. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25693 dc483132-0cff-0310-8789-dd5450dbe970 --- src/include/k5-int.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/include') diff --git a/src/include/k5-int.h b/src/include/k5-int.h index 00cb5b113..21228babb 100644 --- a/src/include/k5-int.h +++ b/src/include/k5-int.h @@ -1704,7 +1704,7 @@ decode_krb5_safe(const krb5_data *output, krb5_safe **rep); krb5_error_code decode_krb5_safe_with_body(const krb5_data *output, krb5_safe **rep, - krb5_data *body); + krb5_data **body); krb5_error_code decode_krb5_priv(const krb5_data *output, krb5_priv **rep); @@ -1787,6 +1787,7 @@ struct _krb5_key_data; /* kdb.h */ struct ldap_seqof_key_data { krb5_int32 mkvno; /* Master key version number */ + krb5_int16 kvno; /* kvno of key_data elements (all the same) */ struct _krb5_key_data *key_data; krb5_int16 n_key_data; }; @@ -1797,7 +1798,7 @@ krb5int_ldap_encode_sequence_of_keys(const ldap_seqof_key_data *val, krb5_data **code); krb5_error_code -krb5int_ldap_decode_sequence_of_keys(krb5_data *in, +krb5int_ldap_decode_sequence_of_keys(const krb5_data *in, ldap_seqof_key_data **rep); /************************************************************************* -- cgit