2N/A/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */
2N/A/*
2N/A * src/lib/krb5/asn.1/asn1_k_decode.h
2N/A *
2N/A * Copyright 1994 by the Massachusetts Institute of Technology.
2N/A * All Rights Reserved.
2N/A *
2N/A * Export of this software from the United States of America may
2N/A * require a specific license from the United States Government.
2N/A * It is the responsibility of any person or organization contemplating
2N/A * export to obtain such a license before exporting.
2N/A *
2N/A * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
2N/A * distribute this software and its documentation for any purpose and
2N/A * without fee is hereby granted, provided that the above copyright
2N/A * notice appear in all copies and that both that copyright notice and
2N/A * this permission notice appear in supporting documentation, and that
2N/A * the name of M.I.T. not be used in advertising or publicity pertaining
2N/A * to distribution of the software without specific, written prior
2N/A * permission. Furthermore if you modify this software you must label
2N/A * your software as modified software and not distribute it in such a
2N/A * fashion that it might be confused with the original M.I.T. software.
2N/A * M.I.T. makes no representations about the suitability of
2N/A * this software for any purpose. It is provided "as is" without express
2N/A * or implied warranty.
2N/A */
2N/A
2N/A#ifndef __ASN1_DECODE_KRB5_H__
2N/A#define __ASN1_DECODE_KRB5_H__
2N/A
2N/A#include "k5-int.h"
2N/A#include "krbasn1.h"
2N/A#include "asn1buf.h"
2N/A
2N/A/* asn1_error_code asn1_decode_scalar_type(asn1buf *buf, krb5_scalar *val); */
2N/A/*
2N/A * requires *buf is allocated, *buf's current position points to the
2N/A * beginning of an encoding (<id> <len> <contents>),
2N/A * *val is allocated
2N/A *
2N/A * effects Decodes the encoding in *buf, returning the result in *val.
2N/A *
2N/A * Returns ASN1_BAD_ID if the encoded id does not indicate
2N/A * the proper type.
2N/A *
2N/A * Returns ASN1_OVERRUN if the encoded length exceeds
2N/A * the bounds of *buf
2N/A */
2N/A
2N/A
2N/A/*
2N/A * asn1_error_code asn1_decode_structure_type(asn1buf *buf,
2N/A * krb5_structure *val);
2N/A */
2N/A/*
2N/A * requires *buf is allocated, *buf's current position points to the
2N/A * beginning of an encoding (<id> <len> <contents>),
2N/A * *val is allocated
2N/A *
2N/A * Assumes that *val is a freshly-allocated structure (i.e.
2N/A * does not attempt to clean up or free *val).
2N/A * effects Decodes the encoding in *buf, returning the result in *val.
2N/A *
2N/A * Returns ASN1_BAD_ID if the encoded id does not indicate
2N/A * the proper type.
2N/A *
2N/A * Returns ASN1_OVERRUN if the encoded length exceeds the
2N/A * bounds of *buf
2N/A */
2N/A
2N/A/* asn1_error_code asn1_decode_array_type(asn1buf *buf, krb5_scalar ***val); */
2N/A/*
2N/A * requires *buf is allocated, *buf's current position points to the
2N/A * beginning of an encoding (<id> <len> <contents>)
2N/A *
2N/A * Assumes that *val is empty (i.e. does not attempt to
2N/A * clean up or free *val).
2N/A *
2N/A * effects Decodes the encoding in *buf, returning the result in *val.
2N/A *
2N/A * Returns ASN1_BAD_ID if the encoded id does not indicate
2N/A * the proper type.
2N/A *
2N/A * Returns ASN1_OVERRUN if the encoded length exceeds the
2N/A * bounds of *buf
2N/A */
2N/A
2N/A/* scalars */
2N/Aasn1_error_code asn1_decode_int(asn1buf *buf, int *val);
2N/Aasn1_error_code asn1_decode_int32(asn1buf *buf, krb5_int32 *val);
2N/Aasn1_error_code asn1_decode_kvno(asn1buf *buf, krb5_kvno *val);
2N/Aasn1_error_code asn1_decode_enctype(asn1buf *buf, krb5_enctype *val);
2N/Aasn1_error_code asn1_decode_msgtype(asn1buf *buf, krb5_msgtype *val);
2N/Aasn1_error_code asn1_decode_cksumtype(asn1buf *buf, krb5_cksumtype *val);
2N/Aasn1_error_code asn1_decode_octet(asn1buf *buf, krb5_octet *val);
2N/Aasn1_error_code asn1_decode_addrtype(asn1buf *buf, krb5_addrtype *val);
2N/Aasn1_error_code asn1_decode_authdatatype(asn1buf *buf, krb5_authdatatype *val);
2N/Aasn1_error_code asn1_decode_ui_2(asn1buf *buf, krb5_ui_2 *val);
2N/Aasn1_error_code asn1_decode_ui_4(asn1buf *buf, krb5_ui_4 *val);
2N/Aasn1_error_code asn1_decode_seqnum(asn1buf *buf, krb5_ui_4 *val);
2N/Aasn1_error_code asn1_decode_kerberos_time(asn1buf *buf, krb5_timestamp *val);
2N/Aasn1_error_code asn1_decode_sam_flags(asn1buf *buf, krb5_flags *val);
2N/A
2N/A/* structures */
2N/Aasn1_error_code asn1_decode_realm(asn1buf *buf, krb5_principal *val);
2N/Aasn1_error_code asn1_decode_principal_name(asn1buf *buf, krb5_principal *val);
2N/Aasn1_error_code asn1_decode_checksum(asn1buf *buf, krb5_checksum *val);
2N/Aasn1_error_code asn1_decode_checksum_ptr(asn1buf *buf, krb5_checksum **valptr);
2N/Aasn1_error_code asn1_decode_encryption_key(asn1buf *buf, krb5_keyblock *val);
2N/Aasn1_error_code asn1_decode_encryption_key_ptr(asn1buf *buf,
2N/A krb5_keyblock **valptr);
2N/Aasn1_error_code asn1_decode_encrypted_data(asn1buf *buf, krb5_enc_data *val);
2N/Aasn1_error_code asn1_decode_ticket_flags(asn1buf *buf, krb5_flags *val);
2N/Aasn1_error_code asn1_decode_transited_encoding(asn1buf *buf,
2N/A krb5_transited *val);
2N/Aasn1_error_code asn1_decode_enc_kdc_rep_part(asn1buf *buf,
2N/A krb5_enc_kdc_rep_part *val);
2N/Aasn1_error_code asn1_decode_krb5_flags(asn1buf *buf, krb5_flags *val);
2N/Aasn1_error_code asn1_decode_ap_options(asn1buf *buf, krb5_flags *val);
2N/Aasn1_error_code asn1_decode_kdc_options(asn1buf *buf, krb5_flags *val);
2N/Aasn1_error_code asn1_decode_ticket(asn1buf *buf, krb5_ticket *val);
2N/Aasn1_error_code asn1_decode_ticket_ptr(asn1buf *buf, krb5_ticket **valptr);
2N/Aasn1_error_code asn1_decode_kdc_req(asn1buf *buf, krb5_kdc_req *val);
2N/Aasn1_error_code asn1_decode_kdc_req_body(asn1buf *buf, krb5_kdc_req *val);
2N/Aasn1_error_code asn1_decode_krb_safe_body(asn1buf *buf, krb5_safe *val);
2N/Aasn1_error_code asn1_decode_host_address(asn1buf *buf, krb5_address *val);
2N/Aasn1_error_code asn1_decode_host_address_ptr(asn1buf *buf,
2N/A krb5_address **valptr);
2N/Aasn1_error_code asn1_decode_kdc_rep(asn1buf *buf, krb5_kdc_rep *val);
2N/Aasn1_error_code asn1_decode_last_req_entry(asn1buf *buf,
2N/A krb5_last_req_entry *val);
2N/Aasn1_error_code asn1_decode_last_req_entry_ptr(asn1buf *buf,
2N/A krb5_last_req_entry **valptr);
2N/Aasn1_error_code asn1_decode_authdata_elt(asn1buf *buf, krb5_authdata *val);
2N/Aasn1_error_code asn1_decode_authdata_elt_ptr(asn1buf *buf,
2N/A krb5_authdata **valptr);
2N/Aasn1_error_code asn1_peek_authorization_data(asn1buf *buf,
2N/A unsigned int *num,
2N/A krb5_authdatatype **val);
2N/Aasn1_error_code asn1_decode_krb_cred_info(asn1buf *buf, krb5_cred_info *val);
2N/Aasn1_error_code asn1_decode_krb_cred_info_ptr(asn1buf *buf,
2N/A krb5_cred_info **valptr);
2N/Aasn1_error_code asn1_decode_pa_data(asn1buf *buf, krb5_pa_data *val);
2N/Aasn1_error_code asn1_decode_pa_data_ptr(asn1buf *buf, krb5_pa_data **valptr);
2N/Aasn1_error_code asn1_decode_passwdsequence(asn1buf *buf,
2N/A passwd_phrase_element *val);
2N/Aasn1_error_code asn1_decode_passwdsequence_ptr(asn1buf *buf,
2N/A passwd_phrase_element **valptr);
2N/Aasn1_error_code asn1_decode_sam_challenge(asn1buf *buf,
2N/A krb5_sam_challenge *val);
2N/Aasn1_error_code asn1_decode_sam_challenge_2(asn1buf *buf,
2N/A krb5_sam_challenge_2 *val);
2N/Aasn1_error_code
2N/Aasn1_decode_sam_challenge_2_body(asn1buf *buf,
2N/A krb5_sam_challenge_2_body *val);
2N/Aasn1_error_code asn1_decode_enc_sam_key(asn1buf *buf, krb5_sam_key *val);
2N/Aasn1_error_code
2N/Aasn1_decode_enc_sam_response_enc(asn1buf *buf,
2N/A krb5_enc_sam_response_enc *val);
2N/Aasn1_error_code
2N/Aasn1_decode_enc_sam_response_enc_2(asn1buf *buf,
2N/A krb5_enc_sam_response_enc_2 *val);
2N/Aasn1_error_code asn1_decode_sam_response(asn1buf *buf, krb5_sam_response *val);
2N/Aasn1_error_code asn1_decode_sam_response_2(asn1buf *buf,
2N/A krb5_sam_response_2 *val);
2N/Aasn1_error_code
2N/Aasn1_decode_predicted_sam_response(asn1buf *buf,
2N/A krb5_predicted_sam_response *val);
2N/Aasn1_error_code asn1_decode_external_principal_identifier(
2N/A asn1buf *buf, krb5_external_principal_identifier *val);
2N/Aasn1_error_code asn1_decode_external_principal_identifier_ptr(
2N/A asn1buf *buf, krb5_external_principal_identifier **valptr);
2N/Aasn1_error_code asn1_decode_pa_pk_as_req(asn1buf *buf, krb5_pa_pk_as_req *val);
2N/Aasn1_error_code asn1_decode_trusted_ca(asn1buf *buf, krb5_trusted_ca *val);
2N/Aasn1_error_code asn1_decode_trusted_ca_ptr(asn1buf *buf,
2N/A krb5_trusted_ca **valptr);
2N/Aasn1_error_code asn1_decode_pa_pk_as_req_draft9(asn1buf *buf,
2N/A krb5_pa_pk_as_req_draft9 *val);
2N/Aasn1_error_code asn1_decode_dh_rep_info(asn1buf *buf, krb5_dh_rep_info *val);
2N/Aasn1_error_code asn1_decode_pk_authenticator(asn1buf *buf,
2N/A krb5_pk_authenticator *val);
2N/Aasn1_error_code
2N/Aasn1_decode_pk_authenticator_draft9(asn1buf *buf,
2N/A krb5_pk_authenticator_draft9 *val);
2N/Aasn1_error_code asn1_decode_subject_pk_info(asn1buf *buf,
2N/A krb5_subject_pk_info *val);
2N/Aasn1_error_code
2N/Aasn1_decode_algorithm_identifier(asn1buf *buf, krb5_algorithm_identifier *val);
2N/Aasn1_error_code
2N/Aasn1_decode_algorithm_identifier_ptr(asn1buf *buf,
2N/A krb5_algorithm_identifier **valptr);
2N/Aasn1_error_code asn1_decode_auth_pack(asn1buf *buf, krb5_auth_pack *val);
2N/Aasn1_error_code asn1_decode_auth_pack_draft9(asn1buf *buf,
2N/A krb5_auth_pack_draft9 *val);
2N/Aasn1_error_code asn1_decode_pa_pk_as_rep(asn1buf *buf,
2N/A krb5_pa_pk_as_rep *val);
2N/Aasn1_error_code asn1_decode_pa_pk_as_rep_draft9(asn1buf *buf,
2N/A krb5_pa_pk_as_rep_draft9 *val);
2N/Aasn1_error_code asn1_decode_kdc_dh_key_info(asn1buf *buf,
2N/A krb5_kdc_dh_key_info *val);
2N/Aasn1_error_code asn1_decode_krb5_principal_name(asn1buf *buf,
2N/A krb5_principal *val);
2N/Aasn1_error_code asn1_decode_reply_key_pack(asn1buf *buf,
2N/A krb5_reply_key_pack *val);
2N/Aasn1_error_code
2N/Aasn1_decode_reply_key_pack_draft9(asn1buf *buf,
2N/A krb5_reply_key_pack_draft9 *val);
2N/Aasn1_error_code
2N/Aasn1_decode_sequence_of_typed_data(asn1buf *buf, krb5_typed_data ***val);
2N/Aasn1_error_code asn1_decode_typed_data(asn1buf *buf, krb5_typed_data *val);
2N/Aasn1_error_code asn1_decode_typed_data_ptr(asn1buf *buf,
2N/A krb5_typed_data **valptr);
2N/A
2N/A/* arrays */
2N/Aasn1_error_code asn1_decode_authorization_data(asn1buf *buf,
2N/A krb5_authdata ***val);
2N/Aasn1_error_code asn1_decode_host_addresses(asn1buf *buf, krb5_address ***val);
2N/Aasn1_error_code asn1_decode_sequence_of_ticket(asn1buf *buf,
2N/A krb5_ticket ***val);
2N/Aasn1_error_code asn1_decode_sequence_of_krb_cred_info(asn1buf *buf,
2N/A krb5_cred_info ***val);
2N/Aasn1_error_code asn1_decode_sequence_of_pa_data(asn1buf *buf,
2N/A krb5_pa_data ***val);
2N/Aasn1_error_code asn1_decode_last_req(asn1buf *buf, krb5_last_req_entry ***val);
2N/A
2N/Aasn1_error_code asn1_decode_sequence_of_enctype(asn1buf *buf, int *num,
2N/A krb5_enctype **val);
2N/A
2N/Aasn1_error_code asn1_decode_sequence_of_checksum(asn1buf *buf,
2N/A krb5_checksum ***val);
2N/A
2N/Aasn1_error_code asn1_decode_sequence_of_passwdsequence(asn1buf *buf,
2N/A passwd_phrase_element ***val);
2N/A
2N/Aasn1_error_code asn1_decode_etype_info(asn1buf *buf,
2N/A krb5_etype_info_entry ***val);
2N/Aasn1_error_code asn1_decode_etype_info2(asn1buf *buf,
2N/A krb5_etype_info_entry ***val,
2N/A krb5_boolean v1_3_behavior);
2N/Aasn1_error_code asn1_decode_sequence_of_external_principal_identifier(
2N/A asn1buf *buf, krb5_external_principal_identifier ***val);
2N/Aasn1_error_code asn1_decode_sequence_of_trusted_ca(asn1buf *buf,
2N/A krb5_trusted_ca ***val);
2N/Aasn1_error_code asn1_decode_sequence_of_algorithm_identifier(
2N/A asn1buf *buf, krb5_algorithm_identifier ***val);
2N/A
2N/Aasn1_error_code asn1_decode_setpw_req(asn1buf *buf, krb5_data *rep,
2N/A krb5_principal *principal);
2N/Aasn1_error_code asn1_decode_pa_for_user(asn1buf *buf, krb5_pa_for_user *val);
2N/Aasn1_error_code asn1_decode_s4u_userid(asn1buf *buf, krb5_s4u_userid *val);
2N/Aasn1_error_code asn1_decode_pa_s4u_x509_user(asn1buf *buf,
2N/A krb5_pa_s4u_x509_user *val);
2N/Aasn1_error_code asn1_decode_pa_pac_req(asn1buf *buf, krb5_pa_pac_req *val);
2N/A
2N/Aasn1_error_code asn1_decode_fast_armor(asn1buf *buf, krb5_fast_armor *val);
2N/A
2N/Aasn1_error_code asn1_decode_fast_armor_ptr(asn1buf *buf,
2N/A krb5_fast_armor **val);
2N/A
2N/Aasn1_error_code asn1_decode_fast_finished(asn1buf *buf,
2N/A krb5_fast_finished *val);
2N/A
2N/Aasn1_error_code asn1_decode_fast_finished_ptr(asn1buf *buf,
2N/A krb5_fast_finished **val);
2N/A
2N/Aasn1_error_code asn1_decode_ad_kdcissued(asn1buf *buf, krb5_ad_kdcissued *val);
2N/A
2N/Aasn1_error_code asn1_decode_ad_kdcissued_ptr(asn1buf *buf,
2N/A krb5_ad_kdcissued **val);
2N/A
2N/Aasn1_error_code asn1_decode_ad_signedpath(asn1buf *buf,
2N/A krb5_ad_signedpath *val);
2N/A
2N/A#endif