summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Hudson <ghudson@mit.edu>2012-01-10 17:27:38 +0000
committerGreg Hudson <ghudson@mit.edu>2012-01-10 17:27:38 +0000
commit266f277b07ffae2cbb46e56387b5de0b1d5d7e02 (patch)
treebf7c62787132e7972a39fc3df8a20a8bfae0e999
parentf314eacb35216d43620138780534959b67652ab8 (diff)
downloadkrb5-266f277b07ffae2cbb46e56387b5de0b1d5d7e02.tar.gz
krb5-266f277b07ffae2cbb46e56387b5de0b1d5d7e02.tar.xz
krb5-266f277b07ffae2cbb46e56387b5de0b1d5d7e02.zip
Use DEFTAGGEDTYPE for FAST choice types
pa_fx_fast_request and pa_fx_fast_reply are defined in RFC 6113 as extensible choice types with only one choice, which means they encode as another type with a [0] tag wrapper. Use DEFTAGGEDTYPE to add this wrapper instead of DEFFIELDTYPE/FIELDOF_ENCODEAS, and add a comment describing why. After this change, all uses of DEFFIELDYPE are for dataptr/lenptr types or just simple offset transformations on the base pointer. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25635 dc483132-0cff-0310-8789-dd5450dbe970
-rw-r--r--src/lib/krb5/asn.1/asn1_k_encode.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/lib/krb5/asn.1/asn1_k_encode.c b/src/lib/krb5/asn.1/asn1_k_encode.c
index f149849a9..20a597926 100644
--- a/src/lib/krb5/asn.1/asn1_k_encode.c
+++ b/src/lib/krb5/asn.1/asn1_k_encode.c
@@ -1049,10 +1049,13 @@ static unsigned int fast_armored_req_optional (const void *p) {
optional |= (1u)<<0;
return optional;
}
+DEFSEQTYPE(fast_armored_req, krb5_fast_armored_req, fast_armored_req_fields,
+ fast_armored_req_optional);
-DEFSEQTYPE( fast_armored_req, krb5_fast_armored_req, fast_armored_req_fields, fast_armored_req_optional);
-DEFFIELDTYPE(pa_fx_fast_request, krb5_fast_armored_req,
- FIELDOF_ENCODEAS(krb5_fast_armored_req, fast_armored_req, 0, 0));
+/* This is a CHOICE type with only one choice (so far) and we're not using a
+ * distinguisher/union for it. */
+DEFTAGGEDTYPE(pa_fx_fast_request, CONTEXT_SPECIFIC, CONSTRUCTED, 0, 0,
+ fast_armored_req);
DEFFIELDTYPE(fast_req_padata, krb5_kdc_req,
FIELDOF_NORM(krb5_kdc_req, ptr_seqof_pa_data, padata, -1, 0));
@@ -1105,8 +1108,10 @@ static const struct field_info fast_rep_fields[] = {
};
DEFSEQTYPE(fast_rep, krb5_enc_data, fast_rep_fields, 0);
-DEFFIELDTYPE(pa_fx_fast_reply, krb5_enc_data,
- FIELDOF_ENCODEAS(krb5_enc_data, fast_rep, 0, 0));
+/* This is a CHOICE type with only one choice (so far) and we're not using a
+ * distinguisher/union for it. */
+DEFTAGGEDTYPE(pa_fx_fast_reply, CONTEXT_SPECIFIC, CONSTRUCTED, 0, 0,
+ fast_rep);
static const struct field_info ad_kdcissued_fields[] = {
FIELDOF_NORM(krb5_ad_kdcissued, checksum, ad_checksum, 0, 0),