svn rev #21969: trunk/src/ include/ lib/krb5/ lib/krb5/krb/
ghudson@MIT.EDU
ghudson at MIT.EDU
Wed Feb 11 15:18:46 EST 2009
http://src.mit.edu/fisheye/changelog/krb5/?cs=21969
Commit By: ghudson
Log Message:
Ensure we have a free function for every data type we have an ASN.1
decoder for. Export the new free functions, but only declare them
in k5-int.h since they shouldn't be needed by applications. Also
export a couple of encoder and decoder functions not previously
exported.
Changed Files:
U trunk/src/include/k5-int.h
U trunk/src/lib/krb5/krb/kfree.c
U trunk/src/lib/krb5/libkrb5.exports
Modified: trunk/src/include/k5-int.h
===================================================================
--- trunk/src/include/k5-int.h 2009-02-11 13:01:11 UTC (rev 21968)
+++ trunk/src/include/k5-int.h 2009-02-11 20:18:43 UTC (rev 21969)
@@ -2509,6 +2509,12 @@
(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 **);
Modified: trunk/src/lib/krb5/krb/kfree.c
===================================================================
--- trunk/src/lib/krb5/krb/kfree.c 2009-02-11 13:01:11 UTC (rev 21968)
+++ trunk/src/lib/krb5/krb/kfree.c 2009-02-11 20:18:43 UTC (rev 21969)
@@ -80,6 +80,15 @@
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)
{
if (val == NULL)
@@ -254,6 +263,15 @@
}
}
+void KRB5_CALLCONV
+krb5_free_enc_data(krb5_context context, krb5_enc_data *val)
+{
+ if (val == NULL)
+ return;
+ krb5_free_data_contents(context, &val->ciphertext);
+ free(val);
+}
+
void krb5_free_etype_info(krb5_context context, krb5_etype_info info)
{
int i;
@@ -426,19 +444,30 @@
void KRB5_CALLCONV
+krb5_free_passwd_phrase_element(krb5_context context,
+ passwd_phrase_element *val)
+{
+ register passwd_phrase_element **temp;
+
+ 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_data(context, (*temp)->passwd);
- (*temp)->passwd = 0;
- krb5_free_data(context, (*temp)->phrase);
- (*temp)->phrase = 0;
- free(*temp);
- }
+ for (temp = val; *temp; temp++)
+ krb5_free_passwd_phrase_element(context, *temp);
free(val);
}
Modified: trunk/src/lib/krb5/libkrb5.exports
===================================================================
--- trunk/src/lib/krb5/libkrb5.exports 2009-02-11 13:01:11 UTC (rev 21968)
+++ trunk/src/lib/krb5/libkrb5.exports 2009-02-11 20:18:43 UTC (rev 21969)
@@ -13,10 +13,12 @@
decode_krb5_enc_kdc_rep_part
decode_krb5_enc_priv_part
decode_krb5_enc_sam_response_enc
+decode_krb5_enc_sam_response_enc_2
decode_krb5_enc_tkt_part
decode_krb5_encryption_key
decode_krb5_error
decode_krb5_etype_info
+decode_krb5_etype_info2
decode_krb5_kdc_req_body
decode_krb5_pa_enc_ts
decode_krb5_pa_for_user
@@ -29,6 +31,7 @@
decode_krb5_safe
decode_krb5_sam_challenge
decode_krb5_sam_response
+decode_krb5_sam_response_2
decode_krb5_setpw_req
decode_krb5_tgs_rep
decode_krb5_tgs_req
@@ -47,6 +50,7 @@
encode_krb5_enc_kdc_rep_part
encode_krb5_enc_priv_part
encode_krb5_enc_sam_response_enc
+encode_krb5_enc_sam_response_enc_2
encode_krb5_enc_tkt_part
encode_krb5_encryption_key
encode_krb5_error
@@ -66,6 +70,7 @@
encode_krb5_sam_challenge
encode_krb5_sam_key
encode_krb5_sam_response
+encode_krb5_sam_response_2
encode_krb5_tgs_rep
encode_krb5_tgs_req
encode_krb5_ticket
@@ -192,6 +197,7 @@
krb5_find_serializer
krb5_free_address
krb5_free_addresses
+krb5_free_alt_method
krb5_free_ap_rep
krb5_free_ap_rep_enc_part
krb5_free_ap_req
@@ -209,6 +215,7 @@
krb5_free_data
krb5_free_data_contents
krb5_free_default_realm
+krb5_free_enc_data
krb5_free_enc_kdc_rep_part
krb5_free_enc_sam_response_enc
krb5_free_enc_sam_response_enc_2
@@ -233,6 +240,7 @@
krb5_free_pa_for_user
krb5_free_pa_server_referral_data
krb5_free_pa_svr_referral_data
+krb5_free_passwd_phrase_element
krb5_free_predicted_sam_response
krb5_free_predicted_sam_response_contents
krb5_free_principal
More information about the cvs-krb5
mailing list