aboutsummaryrefslogtreecommitdiff
path: root/src/lib/krb5/asn.1/asn1_k_encode.c
diff options
context:
space:
mode:
authorGreg Hudson <ghudson@mit.edu>2012-02-11 23:25:00 +0000
committerGreg Hudson <ghudson@mit.edu>2012-02-11 23:25:00 +0000
commit87259ab725b81ae2065a4b8e6f6afbfdd806bda7 (patch)
treea30614356e29df54405af76c1084d73412276ac4 /src/lib/krb5/asn.1/asn1_k_encode.c
parent9f9201c7563be17aeec15a25da8662e1abef2de7 (diff)
downloadkrb5-87259ab725b81ae2065a4b8e6f6afbfdd806bda7.zip
krb5-87259ab725b81ae2065a4b8e6f6afbfdd806bda7.tar.gz
krb5-87259ab725b81ae2065a4b8e6f6afbfdd806bda7.tar.bz2
Simplify ASN.1 choice type definitions
Union fields always have an offset of 0 relative to the union base, so we just need tag types for them, not DEFFIELDs. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25686 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/lib/krb5/asn.1/asn1_k_encode.c')
-rw-r--r--src/lib/krb5/asn.1/asn1_k_encode.c23
1 files changed, 7 insertions, 16 deletions
diff --git a/src/lib/krb5/asn.1/asn1_k_encode.c b/src/lib/krb5/asn.1/asn1_k_encode.c
index 6f05f15..80c7fb1 100644
--- a/src/lib/krb5/asn.1/asn1_k_encode.c
+++ b/src/lib/krb5/asn.1/asn1_k_encode.c
@@ -1434,14 +1434,9 @@ DEFSEQTYPE(pa_pk_as_req, krb5_pa_pk_as_req, pa_pk_as_req_fields,
* krb5_data object; pretend that they are wrapped in IMPLICIT OCTET STRING in
* order to wrap them in primitive [1] and [2] tags.
*/
-DEFOFFSETTYPE(trusted_ca_0_untagged, union krb5_trusted_ca_choices,
- principalName, principal);
-DEFTAGGEDTYPE(trusted_ca_0, CONTEXT_SPECIFIC, PRIMITIVE, 0, 0,
- trusted_ca_0_untagged);
-DEFFIELD_IMPLICIT(trusted_ca_1, union krb5_trusted_ca_choices, caName, 1,
- ostring_data);
-DEFFIELD_IMPLICIT(trusted_ca_2, union krb5_trusted_ca_choices,
- issuerAndSerial, 2, ostring_data);
+DEFTAGGEDTYPE(trusted_ca_0, CONTEXT_SPECIFIC, PRIMITIVE, 0, 0, principal);
+DEFCTAGGEDTYPE_IMPLICIT(trusted_ca_1, 1, ostring_data);
+DEFCTAGGEDTYPE_IMPLICIT(trusted_ca_2, 2, ostring_data);
static const struct atype_info *trusted_ca_alternatives[] = {
&k5_atype_trusted_ca_0, &k5_atype_trusted_ca_1, &k5_atype_trusted_ca_2
};
@@ -1546,10 +1541,8 @@ static const struct atype_info *reply_key_pack_draft9_fields[] = {
DEFSEQTYPE(reply_key_pack_draft9, krb5_reply_key_pack_draft9,
reply_key_pack_draft9_fields, NULL);
-DEFFIELD(pa_pk_as_rep_0, union krb5_pa_pk_as_rep_choices, dh_Info, 0,
- dh_rep_info);
-DEFFIELD_IMPLICIT(pa_pk_as_rep_1, union krb5_pa_pk_as_rep_choices, encKeyPack,
- 1, ostring_data);
+DEFCTAGGEDTYPE(pa_pk_as_rep_0, 0, dh_rep_info);
+DEFCTAGGEDTYPE_IMPLICIT(pa_pk_as_rep_1, 1, ostring_data);
static const struct atype_info *pa_pk_as_rep_alternatives[] = {
&k5_atype_pa_pk_as_rep_0, &k5_atype_pa_pk_as_rep_1
};
@@ -1567,10 +1560,8 @@ DEFCOUNTEDTYPE_SIGNED(pa_pk_as_rep, krb5_pa_pk_as_rep, u, choice,
* krb5_data object; pretend that they are wrapped in IMPLICIT OCTET STRING in
* order to wrap them in primitive [0] and [1] tags.
*/
-DEFFIELD_IMPLICIT(pa_pk_as_rep9_0, union krb5_pa_pk_as_rep_draft9_choices,
- dhSignedData, 0, ostring_data);
-DEFFIELD_IMPLICIT(pa_pk_as_rep9_1, union krb5_pa_pk_as_rep_draft9_choices,
- encKeyPack, 1, ostring_data);
+DEFCTAGGEDTYPE_IMPLICIT(pa_pk_as_rep9_0, 0, ostring_data);
+DEFCTAGGEDTYPE_IMPLICIT(pa_pk_as_rep9_1, 1, ostring_data);
static const struct atype_info *pa_pk_as_rep_draft9_alternatives[] = {
&k5_atype_pa_pk_as_rep9_0, &k5_atype_pa_pk_as_rep9_1
};