#define KRB_AP_ERR_IAKERB_KDC_NO_RESPONSE 86 /* The KDC did not respond
to the IAKERB proxy */
-/*
- * This structure is returned in the e-data field of the KRB-ERROR
- * message when the error calling for an alternative form of
- * authentication is returned, KRB_AP_METHOD.
- */
-typedef struct _krb5_alt_method {
- krb5_magic magic;
- krb5_int32 method;
- unsigned int length;
- krb5_octet *data;
-} krb5_alt_method;
-
/*
* A null-terminated array of this structure is returned by the KDC as
* the data part of the ETYPE_INFO preauth type. It informs the
void KRB5_CALLCONV
krb5_free_pa_s4u_x509_user(krb5_context, krb5_pa_s4u_x509_user *);
-void KRB5_CALLCONV
-krb5_free_pa_svr_referral_data(krb5_context, krb5_pa_svr_referral_data *);
-
-void KRB5_CALLCONV
-krb5_free_pa_server_referral_data(krb5_context,
- krb5_pa_server_referral_data * );
-
void KRB5_CALLCONV
krb5_free_pa_pac_req(krb5_context, krb5_pa_pac_req * );
krb5_error_code
encode_krb5_authdata_elt(const krb5_authdata *rep, krb5_data **code);
-krb5_error_code
-encode_krb5_pwd_sequence(const passwd_phrase_element *rep, krb5_data **code);
-
-krb5_error_code
-encode_krb5_pwd_data(const krb5_pwd_data *rep, krb5_data **code);
-
krb5_error_code
encode_krb5_padata_sequence(krb5_pa_data *const *rep, krb5_data **code);
krb5_error_code
encode_krb5_typed_data(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
encode_krb5_etype_info(krb5_etype_info_entry *const *, krb5_data **code);
krb5_error_code
encode_krb5_pa_s4u_x509_user(const krb5_pa_s4u_x509_user *, krb5_data **);
-krb5_error_code
-encode_krb5_pa_svr_referral_data(const krb5_pa_svr_referral_data *,
- krb5_data **);
-
-krb5_error_code
-encode_krb5_pa_server_referral_data(const krb5_pa_server_referral_data *,
- krb5_data **);
-
krb5_error_code
encode_krb5_pa_pac_req(const krb5_pa_pac_req *, krb5_data **);
krb5_error_code
decode_krb5_authdata(const krb5_data *output, krb5_authdata ***rep);
-krb5_error_code
-decode_krb5_pwd_sequence(const krb5_data *output, passwd_phrase_element **rep);
-
-krb5_error_code
-decode_krb5_pwd_data(const krb5_data *output, krb5_pwd_data **rep);
-
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);
-
krb5_error_code
decode_krb5_etype_info(const krb5_data *output, krb5_etype_info_entry ***rep);
krb5_error_code
decode_krb5_pa_s4u_x509_user(const krb5_data *, krb5_pa_s4u_x509_user **);
-krb5_error_code
-decode_krb5_pa_svr_referral_data(const krb5_data *,
- krb5_pa_svr_referral_data **);
-
-krb5_error_code
-decode_krb5_pa_server_referral_data(const krb5_data *,
- krb5_pa_server_referral_data **);
-
krb5_error_code
decode_krb5_pa_pac_req(const krb5_data *, krb5_pa_pac_req **);
void KRB5_CALLCONV krb5_free_cred_enc_part(krb5_context, krb5_cred_enc_part *);
void KRB5_CALLCONV krb5_free_pa_data(krb5_context, krb5_pa_data **);
void KRB5_CALLCONV krb5_free_tkt_authent(krb5_context, krb5_tkt_authent *);
-void KRB5_CALLCONV krb5_free_pwd_data(krb5_context, krb5_pwd_data *);
-void KRB5_CALLCONV krb5_free_pwd_sequences(krb5_context,
- passwd_phrase_element **);
-void KRB5_CALLCONV krb5_free_passwd_phrase_element(krb5_context,
- passwd_phrase_element *);
-void KRB5_CALLCONV krb5_free_alt_method(krb5_context, krb5_alt_method *);
void KRB5_CALLCONV krb5_free_enc_data(krb5_context, krb5_enc_data *);
krb5_error_code krb5_set_config_files(krb5_context, const char **);
krb5_cred_enc_part *enc_part2; /**< Unencrypted version, if available */
} krb5_cred;
-/*
- * Sandia password generation structure
- * Used by internal functions only
- */
+/* Unused, but here for API compatibility. */
typedef struct _passwd_phrase_element {
krb5_magic magic;
krb5_data *passwd;
krb5_data *phrase;
} passwd_phrase_element;
-/*
- * Password data.
- * Used by internal functions only
- */
+/* Unused, but here for API compatibility. */
typedef struct _krb5_pwd_data {
krb5_magic magic;
int sequence_count;
passwd_phrase_element **element;
} krb5_pwd_data;
-/* these need to be here so the typedefs are available for the prototypes */
-/*
- * Note for Windows 2000 compatibility this is encoded
- * in the enc_padata field of the krb5_enc_kdc_rep_part.
- */
+/* Unused, but here for API compatibility. */
typedef struct _krb5_pa_svr_referral_data {
/** Referred name, only realm is required */
krb5_principal principal;
} krb5_pa_svr_referral_data;
+/* Unused, but here for API compatibility. */
typedef struct _krb5_pa_server_referral_data {
krb5_data *referred_realm;
krb5_principal true_principal_name;
}
}
-asn1_error_code
-asn1_decode_passwdsequence(asn1buf *buf, passwd_phrase_element *val)
-{
- setup();
- val->passwd = NULL;
- val->phrase = NULL;
- { begin_structure();
- alloc_data(val->passwd);
- get_lenfield(val->passwd->length,val->passwd->data,
- 0,asn1_decode_charstring);
- val->passwd->magic = KV5M_DATA;
- alloc_data(val->phrase);
- get_lenfield(val->phrase->length,val->phrase->data,
- 1,asn1_decode_charstring);
- val->phrase->magic = KV5M_DATA;
- end_structure();
- val->magic = KV5M_PASSWD_PHRASE_ELEMENT;
- }
- return 0;
-error_out:
- krb5_free_data(NULL, val->passwd);
- krb5_free_data(NULL, val->phrase);
- val->passwd = NULL;
- val->phrase = NULL;
- return 0;
-}
-
-asn1_error_code
-asn1_decode_passwdsequence_ptr(asn1buf *buf, passwd_phrase_element **valptr)
-{
- decode_ptr(passwd_phrase_element *, asn1_decode_passwdsequence);
-}
-
-asn1_error_code
-asn1_decode_sequence_of_passwdsequence(asn1buf *buf,
- passwd_phrase_element ***val)
-{
- decode_array_body(passwd_phrase_element,asn1_decode_passwdsequence_ptr,
- krb5_free_passwd_phrase_element);
-}
asn1_error_code
asn1_decode_setpw_req(asn1buf *buf, krb5_data *newpasswd,
krb5_principal *principal)
krb5_cred_info **valptr);
asn1_error_code asn1_decode_pa_data(asn1buf *buf, krb5_pa_data *val);
asn1_error_code asn1_decode_pa_data_ptr(asn1buf *buf, krb5_pa_data **valptr);
-asn1_error_code asn1_decode_passwdsequence(asn1buf *buf,
- passwd_phrase_element *val);
-asn1_error_code asn1_decode_passwdsequence_ptr(asn1buf *buf,
- passwd_phrase_element **valptr);
asn1_error_code asn1_decode_sam_challenge_2(asn1buf *buf,
krb5_sam_challenge_2 *val);
asn1_error_code
asn1_error_code asn1_decode_sequence_of_checksum(asn1buf *buf,
krb5_checksum ***val);
-asn1_error_code asn1_decode_sequence_of_passwdsequence(asn1buf *buf,
- passwd_phrase_element ***val);
-
asn1_error_code asn1_decode_etype_info(asn1buf *buf,
krb5_etype_info_entry ***val);
asn1_error_code asn1_decode_etype_info2(asn1buf *buf,
DEFPTRTYPE(etype_info2_entry_ptr, etype_info2_entry);
DEFNULLTERMSEQOFTYPE(etype_info2, etype_info2_entry_ptr);
-static const struct field_info passwdsequence_fields[] = {
- FIELDOF_NORM(passwd_phrase_element, ostring_data_ptr, passwd, 0, 0),
- FIELDOF_NORM(passwd_phrase_element, ostring_data_ptr, phrase, 1, 0),
-};
-DEFSEQTYPE(passwdsequence, passwd_phrase_element, passwdsequence_fields, 0);
-
-DEFPTRTYPE(passwdsequence_ptr, passwdsequence);
-DEFNONEMPTYNULLTERMSEQOFTYPE(seqof_passwdsequence, passwdsequence_ptr);
-DEFPTRTYPE(ptr_seqof_passwdsequence, seqof_passwdsequence);
-
static const struct field_info sam_challenge_2_fields[] = {
FIELDOF_NORM(krb5_sam_challenge_2, opaque_data, sam_challenge_2_body,
0, 0),
DEFSEQTYPE(untagged_krb5_error, krb5_error, error_fields, optional_error);
DEFAPPTAGGEDTYPE(krb5_error, 30, untagged_krb5_error);
-static const struct field_info alt_method_fields[] = {
- FIELDOF_NORM(krb5_alt_method, int32, method, 0, 0),
- FIELDOF_OPTSTRING(krb5_alt_method, octetstring, data, length, 1, 0, 1),
-};
-static unsigned int
-optional_alt_method(const void *p)
-{
- const krb5_alt_method *a = p;
- unsigned int optional = 0;
-
- if (a->data != NULL && a->length > 0)
- optional |= (1u << 1);
-
- return optional;
-}
-DEFSEQTYPE(alt_method, krb5_alt_method, alt_method_fields, optional_alt_method);
-
static const struct field_info pa_enc_ts_fields[] = {
FIELDOF_NORM(krb5_pa_enc_ts, kerberos_time, patimestamp, 0, 0),
FIELDOF_OPT(krb5_pa_enc_ts, int32, pausec, 1, 0, 1),
}
DEFSEQTYPE(pa_enc_ts, krb5_pa_enc_ts, pa_enc_ts_fields, optional_pa_enc_ts);
-static const struct field_info pwd_data_fields[] = {
- FIELDOF_NORM(krb5_pwd_data, int32, sequence_count, 0, 0),
- FIELDOF_NORM(krb5_pwd_data, ptr_seqof_passwdsequence, element, 1, 0),
-};
-DEFSEQTYPE(pwd_data, krb5_pwd_data, pwd_data_fields, 0);
-
static const struct field_info setpw_req_fields[] = {
FIELDOF_NORM(struct krb5_setpw_req, ostring_data, password, 0, 0),
FIELDOF_NORM(struct krb5_setpw_req, principal, target, 1, 0),
DEFSEQTYPE(pa_s4u_x509_user, krb5_pa_s4u_x509_user, pa_s4u_x509_user_fields, 0);
-/* draft-ietf-krb-wg-kerberos-referrals Appendix A. */
-static const struct field_info pa_svr_referral_data_fields[] = {
- FIELDOF_NORM(krb5_pa_svr_referral_data, realm_of_principal, principal,
- 0, 0),
- FIELDOF_OPT(krb5_pa_svr_referral_data, principal, principal, 1, 0, 1),
-};
-
-DEFSEQTYPE(pa_svr_referral_data, krb5_pa_svr_referral_data, pa_svr_referral_data_fields, 0);
-
-/* draft-ietf-krb-wg-kerberos-referrals Section 8. */
-static const struct field_info pa_server_referral_data_fields[] = {
- FIELDOF_OPT(krb5_pa_server_referral_data, gstring_data_ptr, referred_realm,
- 0, 0, 0),
- FIELDOF_OPT(krb5_pa_server_referral_data, principal, true_principal_name,
- 1, 0, 1),
- FIELDOF_OPT(krb5_pa_server_referral_data, principal,
- requested_principal_name, 2, 0, 2),
- FIELDOF_OPT(krb5_pa_server_referral_data, kerberos_time,
- referral_valid_until, 3, 0, 3),
- FIELDOF_NORM(krb5_pa_server_referral_data, checksum, rep_cksum, 4, 0),
-};
-
-DEFSEQTYPE(pa_server_referral_data, krb5_pa_server_referral_data, pa_server_referral_data_fields, 0);
-
#if 0
/* draft-brezak-win2k-krb-authz Section 6. */
static const struct field_info pa_pac_request_fields[] = {
MAKE_FULL_ENCODER(encode_krb5_error, krb5_error);
MAKE_FULL_ENCODER(encode_krb5_authdata, auth_data);
MAKE_FULL_ENCODER(encode_krb5_authdata_elt, authdata_elt);
-MAKE_FULL_ENCODER(encode_krb5_alt_method, alt_method);
MAKE_FULL_ENCODER(encode_krb5_etype_info, etype_info);
MAKE_FULL_ENCODER(encode_krb5_etype_info2, etype_info2);
MAKE_FULL_ENCODER(encode_krb5_enc_data, encrypted_data);
MAKE_FULL_ENCODER(encode_krb5_pa_enc_ts, pa_enc_ts);
-/* Sandia Additions */
-MAKE_FULL_ENCODER(encode_krb5_pwd_sequence, passwdsequence);
-MAKE_FULL_ENCODER(encode_krb5_pwd_data, pwd_data);
MAKE_FULL_ENCODER(encode_krb5_padata_sequence, seq_of_pa_data);
/* sam preauth additions */
MAKE_FULL_ENCODER(encode_krb5_sam_challenge_2, sam_challenge_2);
MAKE_FULL_ENCODER(encode_krb5_pa_for_user, pa_for_user);
MAKE_FULL_ENCODER(encode_krb5_s4u_userid, s4u_userid);
MAKE_FULL_ENCODER(encode_krb5_pa_s4u_x509_user, pa_s4u_x509_user);
-MAKE_FULL_ENCODER(encode_krb5_pa_svr_referral_data, pa_svr_referral_data);
-MAKE_FULL_ENCODER(encode_krb5_pa_server_referral_data, pa_server_referral_data);
MAKE_FULL_ENCODER(encode_krb5_etype_list, etype_list);
MAKE_FULL_ENCODER(encode_krb5_pa_fx_fast_request, pa_fx_fast_request);
cleanup_none(); /* we're not allocating anything here... */
}
-krb5_error_code
-decode_krb5_pwd_sequence(const krb5_data *code, passwd_phrase_element **repptr)
-{
- setup_buf_only(passwd_phrase_element *);
- alloc_field(rep);
- retval = asn1_decode_passwdsequence(&buf,rep);
- if (retval) clean_return(retval);
- cleanup(free);
-}
-
-krb5_error_code
-decode_krb5_pwd_data(const krb5_data *code, krb5_pwd_data **repptr)
-{
- setup(krb5_pwd_data *);
- alloc_field(rep);
- clear_field(rep,element);
- { begin_structure();
- get_field(rep->sequence_count,0,asn1_decode_int);
- get_field(rep->element,1,asn1_decode_sequence_of_passwdsequence);
- rep->magic = KV5M_PWD_DATA;
- end_structure (); }
- cleanup_manual();
-error_out:
- krb5_free_pwd_data(NULL, rep);
- return retval;
-}
-
krb5_error_code
decode_krb5_padata_sequence(const krb5_data *code, krb5_pa_data ***repptr)
{
cleanup_none(); /* we're not allocating anything here */
}
-krb5_error_code
-decode_krb5_alt_method(const krb5_data *code, krb5_alt_method **repptr)
-{
- setup(krb5_alt_method *);
- alloc_field(rep);
- clear_field(rep,data);
- { begin_structure();
- get_field(rep->method,0,asn1_decode_int32);
- if (tagnum == 1) {
- get_lenfield(rep->length,rep->data,1,asn1_decode_octetstring);
- } else {
- rep->length = 0;
- rep->data = 0;
- }
- rep->magic = KV5M_ALT_METHOD;
- end_structure();
- }
- cleanup_manual();
-error_out:
- krb5_free_alt_method(NULL, rep);
- return retval;
-}
-
krb5_error_code
decode_krb5_etype_info(const krb5_data *code, krb5_etype_info_entry ***repptr)
{
free(val);
}
-
-void KRB5_CALLCONV
-krb5_free_alt_method(krb5_context context,
- krb5_alt_method *alt)
-{
- if (alt) {
- free(alt->data);
- free(alt);
- }
-}
void KRB5_CALLCONV
krb5_free_ap_rep(krb5_context context, register krb5_ap_rep *val)
{
free(val);
}
-void KRB5_CALLCONV
-krb5_free_pwd_data(krb5_context context, krb5_pwd_data *val)
-{
- if (val == NULL)
- return;
- krb5_free_pwd_sequences(context, val->element);
- free(val);
-}
-
-
-void KRB5_CALLCONV
-krb5_free_passwd_phrase_element(krb5_context context,
- passwd_phrase_element *val)
-{
- if (val == NULL)
- return;
- krb5_free_data(context, val->passwd);
- val->passwd = NULL;
- krb5_free_data(context, val->phrase);
- val->phrase = NULL;
- free(val);
-}
-
-
-void KRB5_CALLCONV
-krb5_free_pwd_sequences(krb5_context context, passwd_phrase_element **val)
-{
- register passwd_phrase_element **temp;
-
- if (val == NULL)
- return;
- for (temp = val; *temp; temp++)
- krb5_free_passwd_phrase_element(context, *temp);
- free(val);
-}
-
-
void KRB5_CALLCONV
krb5_free_safe(krb5_context context, register krb5_safe *val)
{
free(req);
}
-void KRB5_CALLCONV
-krb5_free_pa_server_referral_data(krb5_context context,
- krb5_pa_server_referral_data *ref)
-{
- if (ref == NULL)
- return;
- krb5_free_data(context, ref->referred_realm);
- ref->referred_realm = NULL;
- krb5_free_principal(context, ref->true_principal_name);
- ref->true_principal_name = NULL;
- krb5_free_principal(context, ref->requested_principal_name);
- ref->requested_principal_name = NULL;
- krb5_free_checksum_contents(context, &ref->rep_cksum);
- free(ref);
-}
-
-void KRB5_CALLCONV
-krb5_free_pa_svr_referral_data(krb5_context context,
- krb5_pa_svr_referral_data *ref)
-{
- if (ref == NULL)
- return;
- krb5_free_principal(context, ref->principal);
- ref->principal = NULL;
- free(ref);
-}
-
void KRB5_CALLCONV
krb5_free_pa_pac_req(krb5_context context,
krb5_pa_pac_req *req)
_krb5_conf_boolean
decode_krb5_ad_kdcissued
decode_krb5_ad_signedpath
-decode_krb5_alt_method
decode_krb5_ap_rep
decode_krb5_ap_rep_enc_part
decode_krb5_ap_req
decode_krb5_pa_s4u_x509_user
decode_krb5_padata_sequence
decode_krb5_priv
-decode_krb5_pwd_data
-decode_krb5_pwd_sequence
decode_krb5_safe
decode_krb5_sam_challenge_2
decode_krb5_sam_challenge_2_body
encode_krb5_ad_kdcissued
encode_krb5_ad_signedpath_data
encode_krb5_ad_signedpath
-encode_krb5_alt_method
encode_krb5_ap_rep
encode_krb5_ap_rep_enc_part
encode_krb5_ap_req
encode_krb5_pa_for_user
encode_krb5_pa_fx_fast_reply
encode_krb5_pa_s4u_x509_user
-encode_krb5_pa_server_referral_data
-encode_krb5_pa_svr_referral_data
encode_krb5_padata_sequence
encode_krb5_pkinit_supp_pub_info
encode_krb5_priv
-encode_krb5_pwd_data
-encode_krb5_pwd_sequence
encode_krb5_s4u_userid
encode_krb5_safe
encode_krb5_sam_challenge_2
krb5_free_ad_signedpath
krb5_free_address
krb5_free_addresses
-krb5_free_alt_method
krb5_free_ap_rep
krb5_free_ap_rep_enc_part
krb5_free_ap_req
krb5_free_pa_for_user
krb5_free_pa_pac_req
krb5_free_pa_s4u_x509_user
-krb5_free_pa_server_referral_data
-krb5_free_pa_svr_referral_data
-krb5_free_passwd_phrase_element
krb5_free_principal
krb5_free_priv
krb5_free_priv_enc_part
-krb5_free_pwd_data
-krb5_free_pwd_sequences
krb5_free_realm_tree
krb5_free_safe
krb5_free_sam_challenge_2
ktest_destroy_authorization_data(&ad);
}
- /****************************************************************/
- /* encode_pwd_sequence */
- {
- passwd_phrase_element ppe, *tmp;
-
- ktest_make_sample_passwd_phrase_element(&ppe);
- leak_test(ppe, encode_krb5_pwd_sequence, decode_krb5_pwd_sequence,
- krb5_free_passwd_phrase_element);
- ktest_empty_passwd_phrase_element(&ppe);
- }
-
- /****************************************************************/
- /* encode_passwd_data */
- {
- krb5_pwd_data pd, *tmp;
-
- ktest_make_sample_krb5_pwd_data(&pd);
- leak_test(pd, encode_krb5_pwd_data, decode_krb5_pwd_data,
- krb5_free_pwd_data);
- ktest_empty_pwd_data(&pd);
- }
-
/****************************************************************/
/* encode_padata_sequence and encode_typed_data */
{
ktest_destroy_pa_data_array(&pa);
}
- /****************************************************************/
- /* encode_alt_method */
- {
- krb5_alt_method am, *tmp;
-
- ktest_make_sample_alt_method(&am);
- leak_test(am, encode_krb5_alt_method, decode_krb5_alt_method,
- krb5_free_alt_method);
- am.length = 0;
- if (am.data)
- free(am.data);
- am.data = 0;
- leak_test(am, encode_krb5_alt_method, decode_krb5_alt_method,
- krb5_free_alt_method);
- ktest_empty_alt_method(&am);
- }
-
/****************************************************************/
/* encode_etype_info */
{
krb5_context test_context;
int error_count = 0;
-void krb5_ktest_free_alt_method(krb5_context context, krb5_alt_method *val);
-void krb5_ktest_free_pwd_sequence(krb5_context context,
- passwd_phrase_element *val);
void krb5_ktest_free_enc_data(krb5_context context, krb5_enc_data *val);
int main(argc, argv)
ktest_destroy_authorization_data(&ref);
}
- /****************************************************************/
- /* decode_pwd_sequence */
- {
- setup(passwd_phrase_element,ktest_make_sample_passwd_phrase_element);
- decode_run("PasswdSequence","","30 18 A0 0A 04 08 6B 72 62 35 64 61 74 61 A1 0A 04 08 6B 72 62 35 64 61 74 61",decode_krb5_pwd_sequence,ktest_equal_passwd_phrase_element,krb5_ktest_free_pwd_sequence);
- ktest_empty_passwd_phrase_element(&ref);
- }
-
- /****************************************************************/
- /* decode_passwd_data */
- {
- setup(krb5_pwd_data,ktest_make_sample_krb5_pwd_data);
- decode_run("PasswdData","","30 3D A0 03 02 01 02 A1 36 30 34 30 18 A0 0A 04 08 6B 72 62 35 64 61 74 61 A1 0A 04 08 6B 72 62 35 64 61 74 61 30 18 A0 0A 04 08 6B 72 62 35 64 61 74 61 A1 0A 04 08 6B 72 62 35 64 61 74 61",decode_krb5_pwd_data,ktest_equal_krb5_pwd_data,krb5_free_pwd_data);
- ktest_empty_pwd_data(&ref);
- }
-
/****************************************************************/
/* decode_krb5_padata_sequence and decode_krb5_typed_data */
{
ktest_destroy_pa_data_array(&ref);
}
- /****************************************************************/
- /* decode_pwd_sequence */
- {
- setup(krb5_alt_method,ktest_make_sample_alt_method);
- decode_run("alt_method","","30 0F A0 03 02 01 2A A1 08 04 06 73 65 63 72 65 74",decode_krb5_alt_method,ktest_equal_krb5_alt_method,krb5_ktest_free_alt_method);
- ref.length = 0;
- decode_run("alt_method (no data)","","30 05 A0 03 02 01 2A",decode_krb5_alt_method,ktest_equal_krb5_alt_method,krb5_ktest_free_alt_method);
- ktest_empty_alt_method(&ref);
- }
-
/****************************************************************/
/* decode_etype_info */
{
}
-void krb5_ktest_free_alt_method(krb5_context context, krb5_alt_method *val)
-{
- if (val->data)
- free(val->data);
- free(val);
-}
-
-void krb5_ktest_free_pwd_sequence(krb5_context context,
- passwd_phrase_element *val)
-{
- krb5_free_data(context, val->passwd);
- krb5_free_data(context, val->phrase);
- free(val);
-}
-
void krb5_ktest_free_enc_data(krb5_context context, krb5_enc_data *val)
{
if (val) {
ktest_destroy_authorization_data(&ad);
}
- /****************************************************************/
- /* encode_pwd_sequence */
- {
- passwd_phrase_element ppe;
- ktest_make_sample_passwd_phrase_element(&ppe);
- encode_run(ppe,passwd_phrase_element,"pwd_sequence","",encode_krb5_pwd_sequence);
- ktest_empty_passwd_phrase_element(&ppe);
- }
-
- /****************************************************************/
- /* encode_passwd_data */
- {
- krb5_pwd_data pd;
- ktest_make_sample_krb5_pwd_data(&pd);
- encode_run(pd,krb5_pwd_data,"pwd_data","",encode_krb5_pwd_data);
- ktest_empty_pwd_data(&pd);
- }
-
/****************************************************************/
/* encode_padata_sequence and encode_krb5_typed_data */
{
ktest_destroy_pa_data_array(&pa);
}
- /****************************************************************/
- /* encode_alt_method */
- {
- krb5_alt_method am;
- ktest_make_sample_alt_method(&am);
- encode_run(am,krb5_alt_method,"alt_method","",encode_krb5_alt_method);
- am.length = 0;
- if (am.data)
- free(am.data);
- am.data = 0;
- encode_run(am,krb5_alt_method,"alt_method (no data)","",
- encode_krb5_alt_method);
- ktest_empty_alt_method(&am);
- }
-
/****************************************************************/
/* encode_etype_info */
{
krb5_data_parse(d, "krb5data");
}
-void
-ktest_make_sample_passwd_phrase_element(passwd_phrase_element *ppe)
-{
- ppe->passwd = ealloc(sizeof(krb5_data));
- ktest_make_sample_data(ppe->passwd);
- ppe->phrase = ealloc(sizeof(krb5_data));
- ktest_make_sample_data(ppe->phrase);
-}
-
-void
-ktest_make_sample_krb5_pwd_data(krb5_pwd_data *pd)
-{
- int i;
-
- pd->sequence_count = 2;
- pd->element = ealloc(3 * sizeof(passwd_phrase_element *));
- for (i = 0; i <= 1; i++) {
- pd->element[i] = ealloc(sizeof(passwd_phrase_element));
- ktest_make_sample_passwd_phrase_element(pd->element[i]);
- }
- pd->element[2] = NULL;
-}
-
-void
-ktest_make_sample_alt_method(krb5_alt_method *p)
-{
- p->method = 42;
- p->data = (unsigned char *)estrdup("secret");
- p->length = strlen((char *)p->data);
-}
-
void
ktest_make_sample_etype_info(krb5_etype_info_entry ***p)
{
ktest_destroy_keyblock(&(arep)->subkey);
}
-void
-ktest_empty_passwd_phrase_element(passwd_phrase_element *ppe)
-{
- ktest_destroy_data(&ppe->passwd);
- ktest_destroy_data(&ppe->phrase);
-}
-
-void
-ktest_empty_pwd_data(krb5_pwd_data *pd)
-{
- int i;
-
- for (i = 0; i <= pd->sequence_count; i++) {
- if (pd->element[i]) {
- ktest_empty_passwd_phrase_element(pd->element[i]);
- free(pd->element[i]);
- }
- }
- free(pd->element);
-}
-
-void
-ktest_empty_alt_method(krb5_alt_method *am)
-{
- free(am->data);
- am->data = NULL;
-}
-
void
ktest_empty_sam_challenge_2(krb5_sam_challenge_2 *p)
{
void ktest_make_sample_error(krb5_error *kerr);
void ktest_make_sequence_of_cred_info(krb5_cred_info ***soci);
void ktest_make_sample_cred_info(krb5_cred_info *ci);
-void ktest_make_sample_passwd_phrase_element(passwd_phrase_element *ppe);
-void ktest_make_sample_krb5_pwd_data(krb5_pwd_data *pd);
-void ktest_make_sample_alt_method(krb5_alt_method *am);
void ktest_make_sample_etype_info(krb5_etype_info_entry ***p);
void ktest_make_sample_etype_info2(krb5_etype_info_entry ***p);
void ktest_empty_cred(krb5_cred *c);
void ktest_destroy_last_req(krb5_last_req_entry ***lr);
void ktest_empty_ap_rep_enc_part(krb5_ap_rep_enc_part *arep);
-void ktest_empty_passwd_phrase_element(passwd_phrase_element *ppe);
-void ktest_empty_pwd_data(krb5_pwd_data *pd);
-void ktest_empty_alt_method(krb5_alt_method *am);
void ktest_empty_sam_challenge_2(krb5_sam_challenge_2 *p);
void ktest_empty_sam_challenge_2_body(krb5_sam_challenge_2_body *p);
void ktest_empty_sam_response_2(krb5_sam_response_2 *p);
return p;
}
-int
-ktest_equal_passwd_phrase_element(passwd_phrase_element *ref,
- passwd_phrase_element *var)
-{
- int p = TRUE;
- if (ref == var) return TRUE;
- else if (ref == NULL || var == NULL) return FALSE;
- p = p && ptr_equal(passwd,ktest_equal_data);
- p = p && ptr_equal(phrase,ktest_equal_data);
- return p;
-}
-
-int
-ktest_equal_krb5_pwd_data(krb5_pwd_data *ref, krb5_pwd_data *var)
-{
- int p = TRUE;
- if (ref == var) return TRUE;
- else if (ref == NULL || var == NULL) return FALSE;
- p = p && scalar_equal(sequence_count);
- p = p && ptr_equal(element,ktest_equal_array_of_passwd_phrase_element);
- return p;
-}
-
-int
-ktest_equal_krb5_alt_method(krb5_alt_method *ref, krb5_alt_method *var)
-{
- if (ref->method != var->method)
- return FALSE;
- if (ref->length != var->length)
- return FALSE;
- if (memcmp(ref->data, var->data, ref->length) != 0)
- return FALSE;
- return TRUE;
-}
-
int
ktest_equal_krb5_etype_info_entry(krb5_etype_info_entry *ref,
krb5_etype_info_entry *var)
array_compare(ktest_equal_principal_data);
}
-int
-ktest_equal_array_of_passwd_phrase_element(passwd_phrase_element **ref, passwd_phrase_element **var)
-{
- array_compare(ktest_equal_passwd_phrase_element);
-}
-
int
ktest_equal_etype_info(krb5_etype_info_entry **ref, krb5_etype_info_entry **var)
{
generic(ktest_equal_kdc_req_body,krb5_kdc_req);
generic(ktest_equal_encryption_key,krb5_keyblock);
-generic(ktest_equal_passwd_phrase_element,passwd_phrase_element);
-generic(ktest_equal_krb5_pwd_data,krb5_pwd_data);
-generic(ktest_equal_krb5_alt_method,krb5_alt_method);
generic(ktest_equal_krb5_pa_enc_ts,krb5_pa_enc_ts);
generic(ktest_equal_sam_challenge_2,krb5_sam_challenge_2);
len_array(ktest_equal_array_of_data,krb5_data);
len_unsigned_array(ktest_equal_array_of_octet,krb5_octet);
-int ktest_equal_array_of_passwd_phrase_element(passwd_phrase_element **ref,
- passwd_phrase_element **var);
int ktest_equal_authorization_data(krb5_authdata **ref, krb5_authdata **var);
int ktest_equal_addresses(krb5_address **ref, krb5_address **var);
int ktest_equal_array_of_char(const unsigned int length, char *ref, char *var);
encode_krb5_error: 7E 81 BA 30 81 B7 A0 03 02 01 05 A1 03 02 01 1E A2 11 18 0F 31 39 39 34 30 36 31 30 30 36 30 33 31 37 5A A3 05 02 03 01 E2 40 A4 11 18 0F 31 39 39 34 30 36 31 30 30 36 30 33 31 37 5A A5 05 02 03 01 E2 40 A6 03 02 01 3C A7 10 1B 0E 41 54 48 45 4E 41 2E 4D 49 54 2E 45 44 55 A8 1A 30 18 A0 03 02 01 01 A1 11 30 0F 1B 06 68 66 74 73 61 69 1B 05 65 78 74 72 61 A9 10 1B 0E 41 54 48 45 4E 41 2E 4D 49 54 2E 45 44 55 AA 1A 30 18 A0 03 02 01 01 A1 11 30 0F 1B 06 68 66 74 73 61 69 1B 05 65 78 74 72 61 AB 0A 1B 08 6B 72 62 35 64 61 74 61 AC 0A 04 08 6B 72 62 35 64 61 74 61
encode_krb5_error(optionals NULL): 7E 60 30 5E A0 03 02 01 05 A1 03 02 01 1E A3 05 02 03 01 E2 40 A4 11 18 0F 31 39 39 34 30 36 31 30 30 36 30 33 31 37 5A A5 05 02 03 01 E2 40 A6 03 02 01 3C A9 10 1B 0E 41 54 48 45 4E 41 2E 4D 49 54 2E 45 44 55 AA 1A 30 18 A0 03 02 01 01 A1 11 30 0F 1B 06 68 66 74 73 61 69 1B 05 65 78 74 72 61
encode_krb5_authorization_data: 30 22 30 0F A0 03 02 01 01 A1 08 04 06 66 6F 6F 62 61 72 30 0F A0 03 02 01 01 A1 08 04 06 66 6F 6F 62 61 72
-encode_krb5_pwd_sequence: 30 18 A0 0A 04 08 6B 72 62 35 64 61 74 61 A1 0A 04 08 6B 72 62 35 64 61 74 61
-encode_krb5_pwd_data: 30 3D A0 03 02 01 02 A1 36 30 34 30 18 A0 0A 04 08 6B 72 62 35 64 61 74 61 A1 0A 04 08 6B 72 62 35 64 61 74 61 30 18 A0 0A 04 08 6B 72 62 35 64 61 74 61 A1 0A 04 08 6B 72 62 35 64 61 74 61
encode_krb5_padata_sequence: 30 24 30 10 A1 03 02 01 0D A2 09 04 07 70 61 2D 64 61 74 61 30 10 A1 03 02 01 0D A2 09 04 07 70 61 2D 64 61 74 61
encode_krb5_typed_data: 30 24 30 10 A0 03 02 01 0D A1 09 04 07 70 61 2D 64 61 74 61 30 10 A0 03 02 01 0D A1 09 04 07 70 61 2D 64 61 74 61
encode_krb5_padata_sequence(empty): 30 00
-encode_krb5_alt_method: 30 0F A0 03 02 01 2A A1 08 04 06 73 65 63 72 65 74
-encode_krb5_alt_method (no data): 30 05 A0 03 02 01 2A
encode_krb5_etype_info: 30 33 30 14 A0 03 02 01 00 A1 0D 04 0B 4D 6F 72 74 6F 6E 27 73 20 23 30 30 05 A0 03 02 01 01 30 14 A0 03 02 01 02 A1 0D 04 0B 4D 6F 72 74 6F 6E 27 73 20 23 32
encode_krb5_etype_info (only 1): 30 16 30 14 A0 03 02 01 00 A1 0D 04 0B 4D 6F 72 74 6F 6E 27 73 20 23 30
encode_krb5_etype_info (no info): 30 00
. . [ad-type] [Integer] 1
. . [ad-data] [Octet String] "foobar"
-encode_krb5_pwd_sequence:
-
-[Sequence/Sequence Of]
-. [0] [Octet String] "krb5data"
-. [1] [Octet String] "krb5data"
-
-encode_krb5_pwd_data:
-
-[Sequence/Sequence Of]
-. [0] [Integer] 2
-. [1] [Sequence/Sequence Of]
-. . [Sequence/Sequence Of]
-. . . [0] [Octet String] "krb5data"
-. . . [1] [Octet String] "krb5data"
-. . [Sequence/Sequence Of]
-. . . [0] [Octet String] "krb5data"
-. . . [1] [Octet String] "krb5data"
-
encode_krb5_padata_sequence:
[Sequence/Sequence Of]
[Sequence/Sequence Of]
-encode_krb5_alt_method:
-
-[Sequence/Sequence Of]
-. [0] [Integer] 42
-. [1] [Octet String] "secret"
-
-encode_krb5_alt_method (no data):
-
-[Sequence/Sequence Of]
-. [0] [Integer] 42
-
encode_krb5_etype_info:
[Sequence/Sequence Of]
krb5_free_tkt_authent,
(krb5_context, krb5_tkt_authent *)
);
-TYPEDEF_FUNC(
- void,
- KRB5_CALLCONV,
- krb5_free_pwd_data,
- (krb5_context, krb5_pwd_data *)
- );
-TYPEDEF_FUNC(
- void,
- KRB5_CALLCONV,
- krb5_free_pwd_sequences,
- (krb5_context, passwd_phrase_element * *)
- );
TYPEDEF_FUNC(
void,
KRB5_CALLCONV,