Permalink
Browse files

Remove some unused structures and encoders

krb5_alt_method was added in r6604 but never supported.  krb5_pwd_data
became unused when the Sandia kadmin system was replaced.
krb5_pa_server_referral_data and krb5_pa_svr_referral_data were added
in r21690 with internally-visible encoders which nothing uses.

Leave behind structure declarations in krb5.hin for API compatibility.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25619 dc483132-0cff-0310-8789-dd5450dbe970
  • Loading branch information...
1 parent 08f6ff0 commit 71f5163bb6534dc0384eb407c3d95489d4456501 ghudson committed Jan 7, 2012
View
@@ -380,18 +380,6 @@ typedef INT64_TYPE krb5_int64;
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
* client which encryption types are supported.
@@ -1089,13 +1077,6 @@ 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 * );
void KRB5_CALLCONV
@@ -1570,21 +1551,12 @@ 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
@@ -1624,14 +1596,6 @@ 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
@@ -1766,21 +1730,12 @@ 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
@@ -1802,14 +1757,6 @@ 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 **);
krb5_error_code
@@ -2472,12 +2419,6 @@ void KRB5_CALLCONV krb5_free_cred(krb5_context, krb5_cred *);
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 **);
View
@@ -2114,36 +2114,27 @@ typedef struct _krb5_cred {
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;
@@ -917,46 +917,6 @@ asn1_decode_etype_info2(asn1buf *buf, krb5_etype_info_entry ***val ,
}
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)
{
@@ -141,10 +141,6 @@ asn1_error_code asn1_decode_krb_cred_info_ptr(asn1buf *buf,
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
@@ -218,9 +214,6 @@ asn1_error_code asn1_decode_sequence_of_enctype(asn1buf *buf, int *num,
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,
@@ -454,16 +454,6 @@ DEFNULLTERMSEQOFTYPE(etype_info, etype_info_entry_ptr);
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),
@@ -961,23 +951,6 @@ optional_error(const void *p)
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),
@@ -995,12 +968,6 @@ optional_pa_enc_ts(const void *p)
}
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),
@@ -1049,30 +1016,6 @@ static const struct field_info pa_s4u_x509_user_fields[] = {
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[] = {
@@ -1311,14 +1254,10 @@ MAKE_FULL_ENCODER(encode_krb5_enc_cred_part, enc_cred_part);
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);
@@ -1331,8 +1270,6 @@ MAKE_FULL_ENCODER(encode_krb5_setpw_req, setpw_req);
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);
Oops, something went wrong.

0 comments on commit 71f5163

Please sign in to comment.