encode_krb5_reply_key_pack_draft9(const krb5_reply_key_pack_draft9 *,
krb5_data **code);
-krb5_error_code
-encode_krb5_typed_data(const krb5_typed_data **, krb5_data **code);
-
krb5_error_code
encode_krb5_td_trusted_certifiers(const krb5_external_principal_identifier **,
krb5_data **code);
decode_krb5_reply_key_pack_draft9(const krb5_data *,
krb5_reply_key_pack_draft9 **);
-krb5_error_code
-decode_krb5_typed_data(const krb5_data *, krb5_typed_data ***);
-
krb5_error_code
decode_krb5_td_trusted_certifiers(const krb5_data *,
krb5_external_principal_identifier ***);
krb5_error_code
decode_krb5_td_dh_parameters(const krb5_data *, krb5_algorithm_identifier ***);
-void krb5_free_typed_data(krb5_context, krb5_typed_data **);
-
krb5_error_code
encode_krb5_enc_data(const krb5_enc_data *, krb5_data **);
krb5_error_code
encode_krb5_padata_sequence(krb5_pa_data *const *rep, krb5_data **code);
+krb5_error_code
+encode_krb5_typed_data(const krb5_pa_data *const *rep, krb5_data **code);
+
krb5_error_code
encode_krb5_alt_method(const krb5_alt_method *, krb5_data **code);
krb5_error_code
decode_krb5_padata_sequence(const krb5_data *output, krb5_pa_data ***rep);
+krb5_error_code
+decode_krb5_typed_data(const krb5_data *, krb5_pa_data ***);
+
krb5_error_code
decode_krb5_alt_method(const krb5_data *output, krb5_alt_method **rep);
/* To keep happy libraries which are (for now) accessing internal stuff */
/* Make sure to increment by one when changing the struct */
-#define KRB5INT_ACCESS_STRUCT_VERSION 18
+#define KRB5INT_ACCESS_STRUCT_VERSION 19
#ifndef ANAME_SZ
struct ktext; /* from krb.h, for krb524 support */
krb5_external_principal_identifier **,
krb5_data **code);
- krb5_error_code
- (*encode_krb5_typed_data)(const krb5_typed_data **, krb5_data **code);
-
krb5_error_code
(*decode_krb5_auth_pack)(const krb5_data *, krb5_auth_pack **);
krb5_external_principal_identifier
***);
- krb5_error_code
- (*decode_krb5_typed_data)(const krb5_data *, krb5_typed_data ***);
-
krb5_error_code
(*decode_krb5_as_req)(const krb5_data *output, krb5_kdc_req **rep);
krb5_octet *contents; /**< Data */
} krb5_pa_data;
-/*
- * The FAST error handling logic currently assumes that pointers to this
- * structure and krb5_pa_data can be safely cast to each other. If this
- * structure changes, that code needs to be updated to copy.
- */
-/** Typed data */
+/* Don't use this; use krb5_pa_data instead. */
typedef struct _krb5_typed_data {
krb5_magic magic;
krb5_int32 type;
errpkt.text = string2data((char *)status);
if (e_data != NULL) {
- if (typed_e_data) {
- retval = encode_krb5_typed_data((const krb5_typed_data **)e_data,
- &e_data_asn1);
- } else
+ if (typed_e_data)
+ retval = encode_krb5_typed_data(e_data, &e_data_asn1);
+ else
retval = encode_krb5_padata_sequence(e_data, &e_data_asn1);
if (retval)
goto cleanup;
#endif /* DISABLE_PKINIT */
-static void free_typed_data(void *dummy, krb5_typed_data *val)
-{
- free(val->data);
- free(val);
-}
-
asn1_error_code
-asn1_decode_sequence_of_typed_data(asn1buf *buf, krb5_typed_data ***val)
+asn1_decode_sequence_of_typed_data(asn1buf *buf, krb5_pa_data ***val)
{
- decode_array_body(krb5_typed_data,asn1_decode_typed_data_ptr,
- free_typed_data);
+ decode_array_body(krb5_pa_data,asn1_decode_typed_data_ptr,
+ free_pa_data);
}
asn1_error_code
-asn1_decode_typed_data(asn1buf *buf, krb5_typed_data *val)
+asn1_decode_typed_data(asn1buf *buf, krb5_pa_data *val)
{
setup();
- val->data = NULL;
+ val->contents = NULL;
{ begin_structure();
- get_field(val->type,0,asn1_decode_int32);
- get_lenfield(val->length,val->data,1,asn1_decode_octetstring);
+ get_field(val->pa_type,0,asn1_decode_int32);
+ get_lenfield(val->length,val->contents,1,asn1_decode_octetstring);
end_structure();
}
return 0;
error_out:
- free(val->data);
- val->data = NULL;
+ free(val->contents);
+ val->contents = NULL;
return retval;
}
asn1_error_code
-asn1_decode_typed_data_ptr(asn1buf *buf, krb5_typed_data **valptr)
+asn1_decode_typed_data_ptr(asn1buf *buf, krb5_pa_data **valptr)
{
- decode_ptr(krb5_typed_data *, asn1_decode_typed_data);
+ decode_ptr(krb5_pa_data *, asn1_decode_typed_data);
}
asn1_decode_reply_key_pack_draft9(asn1buf *buf,
krb5_reply_key_pack_draft9 *val);
asn1_error_code
-asn1_decode_sequence_of_typed_data(asn1buf *buf, krb5_typed_data ***val);
-asn1_error_code asn1_decode_typed_data(asn1buf *buf, krb5_typed_data *val);
+asn1_decode_sequence_of_typed_data(asn1buf *buf, krb5_pa_data ***val);
+asn1_error_code asn1_decode_typed_data(asn1buf *buf, krb5_pa_data *val);
asn1_error_code asn1_decode_typed_data_ptr(asn1buf *buf,
- krb5_typed_data **valptr);
+ krb5_pa_data **valptr);
/* arrays */
asn1_error_code asn1_decode_authorization_data(asn1buf *buf,
#endif /* not DISABLE_PKINIT */
asn1_error_code
-asn1_encode_sequence_of_typed_data(asn1buf *buf, const krb5_typed_data **val,
+asn1_encode_sequence_of_typed_data(asn1buf *buf,
+ const krb5_pa_data *const *val,
unsigned int *retlen)
{
asn1_setup();
}
asn1_error_code
-asn1_encode_typed_data(asn1buf *buf, const krb5_typed_data *val,
+asn1_encode_typed_data(asn1buf *buf, const krb5_pa_data *val,
unsigned int *retlen)
{
asn1_setup();
- asn1_addlenfield(val->length, val->data, 1, asn1_encode_octetstring);
- asn1_addfield(val->type, 0, asn1_encode_integer);
+ asn1_addlenfield(val->length, val->contents, 1, asn1_encode_octetstring);
+ asn1_addfield(val->pa_type, 0, asn1_encode_integer);
asn1_makeseq();
asn1_cleanup();
}
unsigned int *retlen);
asn1_error_code asn1_encode_typed_data(asn1buf *buf,
- const krb5_typed_data *val,
+ const krb5_pa_data *val,
unsigned int *retlen);
-asn1_error_code asn1_encode_sequence_of_typed_data(asn1buf *buf,
- const krb5_typed_data **val,
- unsigned int *retlen);
+asn1_error_code asn1_encode_sequence_of_typed_data(
+ asn1buf *buf, const krb5_pa_data *const *val, unsigned int *retlen);
#endif
#endif /* DISABLE_PKINIT */
krb5_error_code
-decode_krb5_typed_data(const krb5_data *code, krb5_typed_data ***repptr)
+decode_krb5_typed_data(const krb5_data *code, krb5_pa_data ***repptr)
{
- setup_buf_only(krb5_typed_data **);
+ setup_buf_only(krb5_pa_data **);
retval = asn1_decode_sequence_of_typed_data(&buf, &rep);
if (retval) clean_return(retval);
#endif /* DISABLE_PKINIT */
krb5_error_code
-encode_krb5_typed_data(const krb5_typed_data **rep, krb5_data **code)
+encode_krb5_typed_data(const krb5_pa_data *const *rep, krb5_data **code)
{
krb5_setup();
retval = asn1_encode_sequence_of_typed_data(buf,rep,&length);
retval = decode_krb5_padata_sequence(&err_reply->e_data,
out_padata);
if (retval != 0) {
- krb5_typed_data **tdata;
- /* krb5_typed data and krb5_pa_data are compatible. */
- if (decode_krb5_typed_data(&err_reply->e_data, &tdata) == 0)
- *out_padata = (krb5_pa_data **)tdata;
+ (void)decode_krb5_typed_data(&err_reply->e_data, out_padata);
retval = 0;
}
}
free(val);
}
-void
-krb5_free_typed_data(krb5_context context, krb5_typed_data **in)
-{
- int i = 0;
- if (in == NULL) return;
- while (in[i] != NULL) {
- if (in[i]->data != NULL)
- free(in[i]->data);
- free(in[i]);
- i++;
- }
- free(in);
-}
-
void KRB5_CALLCONV
krb5_free_fast_armored_req(krb5_context context, krb5_fast_armored_req *val)
{
krb5_free_ticket
krb5_free_tickets
krb5_free_tkt_authent
-krb5_free_typed_data
krb5_free_unparsed_name
krb5_fwd_tgt_creds
krb5_gen_portaddr
SC (encode_krb5_kdc_dh_key_info, encode_krb5_kdc_dh_key_info),
SC (encode_krb5_reply_key_pack, encode_krb5_reply_key_pack),
SC (encode_krb5_reply_key_pack_draft9, encode_krb5_reply_key_pack_draft9),
- SC (encode_krb5_typed_data, encode_krb5_typed_data),
SC (encode_krb5_td_trusted_certifiers, encode_krb5_td_trusted_certifiers),
SC (encode_krb5_td_dh_parameters, encode_krb5_td_dh_parameters),
SC (decode_krb5_pa_pk_as_req, decode_krb5_pa_pk_as_req),
SC (decode_krb5_principal_name, decode_krb5_principal_name),
SC (decode_krb5_reply_key_pack, decode_krb5_reply_key_pack),
SC (decode_krb5_reply_key_pack_draft9, decode_krb5_reply_key_pack_draft9),
- SC (decode_krb5_typed_data, decode_krb5_typed_data),
SC (decode_krb5_td_trusted_certifiers, decode_krb5_td_trusted_certifiers),
SC (decode_krb5_td_dh_parameters, decode_krb5_td_dh_parameters),
SC (decode_krb5_as_req, decode_krb5_as_req),
void free_krb5_pa_pk_as_rep_draft9(krb5_pa_pk_as_rep_draft9 **in);
void free_krb5_external_principal_identifier(krb5_external_principal_identifier ***in);
void free_krb5_trusted_ca(krb5_trusted_ca ***in);
-void free_krb5_typed_data(krb5_typed_data ***in);
void free_krb5_algorithm_identifiers(krb5_algorithm_identifier ***in);
void free_krb5_algorithm_identifier(krb5_algorithm_identifier *in);
void free_krb5_kdc_dh_key_info(krb5_kdc_dh_key_info **in);
DEF_FUNC_PTRS(krb5_pa_pk_as_req_draft9);
DEF_FUNC_PTRS(krb5_reply_key_pack);
DEF_FUNC_PTRS(krb5_reply_key_pack_draft9);
-DEF_FUNC_PTRS_ARRAY(krb5_typed_data);
/* special cases... */
krb5_error_code
SET_PTRS(krb5_reply_key_pack_draft9);
SET_PTRS(krb5_td_dh_parameters);
SET_PTRS(krb5_td_trusted_certifiers);
- SET_PTRS(krb5_typed_data);
/* special cases... */
k5int_decode_krb5_principal_name = k5int.decode_krb5_principal_name;
DEF_EXT_FUNC_PTRS(krb5_pa_pk_as_req_draft9);
DEF_EXT_FUNC_PTRS(krb5_reply_key_pack);
DEF_EXT_FUNC_PTRS(krb5_reply_key_pack_draft9);
-DEF_EXT_FUNC_PTRS_ARRAY(krb5_typed_data);
/* special cases... */
extern krb5_error_code (*k5int_decode_krb5_principal_name)
free(*in);
}
-void
-free_krb5_typed_data(krb5_typed_data ***in)
-{
- int i = 0;
- if (*in == NULL) return;
- while ((*in)[i] != NULL) {
- free((*in)[i]->data);
- free((*in)[i]);
- i++;
- }
- free(*in);
-}
-
void
free_krb5_algorithm_identifier(krb5_algorithm_identifier *in)
{