Permalink
Browse files

Redesign ASN.1 encoder engine, removing field_info

Replace the "field" half of the ASN.1 encoder machinery with several
new struct atype_info types (offset, counted, and int_immediate) and a
new counted_type machinery used exclusively for object/integer pairs.
This change eliminates the two-way entanglement between atypes and
fields, and makes the encoder more independent of RFC 4120 ASN.1
conventions.

Defining sequences with the preprocessor macros is now slightly more
cumbersome; we need to define a type for each field and then string
them together with an array of struct atype_info *.  But it's not so
bad, and hopefully we can auto-generate some of this soon.

*_optional functions now return a bitmask of sequence field offsets
not present in the C type.  This will need some more attention before
we add decoding support to the engine, since it means sequence fields
no longer know whether they are optional or not.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25657 dc483132-0cff-0310-8789-dd5450dbe970
  • Loading branch information...
1 parent 3064892 commit 244bf1a15493401aee18b4947f7b96f9aae14115 ghudson committed Jan 24, 2012
Showing with 1,373 additions and 1,718 deletions.
  1. +137 −227 src/lib/krb5/asn.1/asn1_encode.c
  2. +203 −388 src/lib/krb5/asn.1/asn1_encode.h
  3. +995 −1,072 src/lib/krb5/asn.1/asn1_k_encode.c
  4. +38 −31 src/lib/krb5/asn.1/ldap_key_seq.c
Oops, something went wrong.

0 comments on commit 244bf1a

Please sign in to comment.