diff options
author | Sam Hartman <hartmans@mit.edu> | 2011-09-19 00:34:52 +0000 |
---|---|---|
committer | Sam Hartman <hartmans@mit.edu> | 2011-09-19 00:34:52 +0000 |
commit | 3e0d13c8278d2885760e405f537a882b896ff156 (patch) | |
tree | 5a9c7c6233959238fd36691a415c5a59f8cef5f0 /src/lib/krb5/asn.1 | |
parent | 61c280a73539acbe68bb203ea8f09cf52cf4b784 (diff) | |
download | krb5-3e0d13c8278d2885760e405f537a882b896ff156.tar.gz krb5-3e0d13c8278d2885760e405f537a882b896ff156.tar.xz krb5-3e0d13c8278d2885760e405f537a882b896ff156.zip |
Added underlying ASN.1 structures for pkinit algorithm agility
Signed-off-by: Margaret Wasserman <mrw@painless-security.com>
tested-by: Sam Hartman <hartmans@debian.org>
fixes-from: Sam Hartman <hartmans@debian.org>
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25190 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/lib/krb5/asn.1')
-rw-r--r-- | src/lib/krb5/asn.1/asn1_k_encode.c | 38 |
1 files changed, 35 insertions, 3 deletions
diff --git a/src/lib/krb5/asn.1/asn1_k_encode.c b/src/lib/krb5/asn.1/asn1_k_encode.c index fffe9474c..7bca6d23b 100644 --- a/src/lib/krb5/asn.1/asn1_k_encode.c +++ b/src/lib/krb5/asn.1/asn1_k_encode.c @@ -1421,6 +1421,39 @@ static unsigned int iakerb_finished_optional(const void *p) DEFSEQTYPE(iakerb_finished, krb5_iakerb_finished, iakerb_finished_fields, iakerb_finished_optional); +DEFFNXTYPE(algorithm_identifier, krb5_algorithm_identifier, asn1_encode_algorithm_identifier); +/* Krb5PrincipalName is defined in RFC 4556 and is *not* PrincipalName from RFC 4120*/ +static const struct field_info pkinit_krb5_principal_name_fields[] = { + FIELDOF_NORM(krb5_principal_data, gstring_data, realm, 0), + FIELDOF_ENCODEAS(krb5_principal_data, principal_data, 1) +}; + + +DEFSEQTYPE(pkinit_krb5_principal_name_data, krb5_principal_data, pkinit_krb5_principal_name_fields, NULL); +DEFPTRTYPE(pkinit_krb5_principal_name, pkinit_krb5_principal_name_data); +DEFOCTETWRAPTYPE(pkinit_krb5_principal_name_wrapped, pkinit_krb5_principal_name); + + +/* For SP80056A OtherInfo, for pkinit agility */ +static const struct field_info sp80056a_other_info_fields[] = { + FIELDOF_NORM(krb5_sp80056a_other_info, algorithm_identifier, algorithm_identifier, -1), + FIELDOF_NORM(krb5_sp80056a_other_info, pkinit_krb5_principal_name_wrapped, party_u_info, 0), + FIELDOF_NORM(krb5_sp80056a_other_info, pkinit_krb5_principal_name_wrapped, party_v_info, 1), + FIELDOF_STRING(krb5_sp80056a_other_info, s_octetstring, supp_pub_info.data, supp_pub_info.length, 2), +}; + +DEFSEQTYPE(sp80056a_other_info, krb5_sp80056a_other_info, sp80056a_other_info_fields, NULL); + +/* For PkinitSuppPubInfo, for pkinit agility */ +static const struct field_info pkinit_supp_pub_info_fields[] = { + FIELDOF_NORM(krb5_pkinit_supp_pub_info, int32, enctype, 0), + FIELDOF_STRING(krb5_pkinit_supp_pub_info, octetstring, as_req.data, as_req.length, 1), + FIELDOF_STRING(krb5_pkinit_supp_pub_info, octetstring, pk_as_rep.data, pk_as_rep.length, 2), + FIELDOF_NORM(krb5_pkinit_supp_pub_info, ticket_ptr, ticket, 3), +}; + +DEFSEQTYPE(pkinit_supp_pub_info, krb5_pkinit_supp_pub_info, pkinit_supp_pub_info_fields, NULL); + /* Exported complete encoders -- these produce a krb5_data with the encoding in the correct byte order. */ @@ -1499,9 +1532,8 @@ MAKE_FULL_ENCODER(encode_krb5_ad_signedpath_data, ad_signedpath_data); MAKE_FULL_ENCODER(encode_krb5_ad_signedpath, ad_signedpath); MAKE_FULL_ENCODER(encode_krb5_iakerb_header, iakerb_header); MAKE_FULL_ENCODER(encode_krb5_iakerb_finished, iakerb_finished); - - - +MAKE_FULL_ENCODER(encode_krb5_pkinit_supp_pub_info, pkinit_supp_pub_info); +MAKE_FULL_ENCODER(encode_krb5_sp80056a_other_info, sp80056a_other_info); /* * PKINIT |