+2004-03-20 Ken Raeburn <raeburn@mit.edu>
+
+ * rel_cred.c (krb5_gss_release_cred): Create and destroy a local
+ krb5 context.
+ * rel_name.c (krb5_gss_release_name): Likewise.
+ * val_cred.c (krb5_gss_validate_cred): Likewise.
+
2004-03-19 Ken Raeburn <raeburn@mit.edu>
* add_cred.c (krb5_gss_add_cred): Create and destroy a local krb5
krb5_gss_cred_id_t cred;
krb5_error_code code1, code2, code3;
- if (GSS_ERROR(kg_get_context(minor_status, &context)))
- return(GSS_S_FAILURE);
+ code1 = krb5_init_context(&context);
+ if (code1) {
+ *minor_status = code1;
+ return GSS_S_FAILURE;
+ }
if (*cred_handle == GSS_C_NO_CREDENTIAL) {
*minor_status = 0;
+ krb5_free_context(context);
return(GSS_S_COMPLETE);
}
if (! kg_delete_cred_id(*cred_handle)) {
*minor_status = (OM_uint32) G_VALIDATE_FAILED;
+ krb5_free_context(context);
return(GSS_S_CALL_BAD_STRUCTURE|GSS_S_NO_CRED);
}
if (cred->princ)
krb5_free_principal(context, cred->princ);
xfree(cred);
+ krb5_free_context(context);
*cred_handle = NULL;
gss_name_t *input_name;
{
krb5_context context;
-
- if (GSS_ERROR(kg_get_context(minor_status, &context)))
- return(GSS_S_FAILURE);
+ krb5_error_code code;
+
+ code = krb5_init_context(&context);
+ if (code) {
+ *minor_status = code;
+ return GSS_S_FAILURE;
+ }
if (! kg_validate_name(*input_name)) {
*minor_status = (OM_uint32) G_VALIDATE_FAILED;
+ krb5_free_context(context);
return(GSS_S_CALL_BAD_STRUCTURE|GSS_S_BAD_NAME);
}
(void)kg_delete_name(*input_name);
krb5_free_principal(context, (krb5_principal) *input_name);
+ krb5_free_context(context);
*input_name = (gss_name_t) NULL;
krb5_error_code code;
krb5_principal princ;
- if (GSS_ERROR(kg_get_context(minor_status, &context)))
- return(GSS_S_FAILURE);
+ code = krb5_init_context(&context);
+ if (code) {
+ *minor_status = code;
+ return GSS_S_FAILURE;
+ }
if (!kg_validate_cred_id(cred_handle)) {
*minor_status = (OM_uint32) G_VALIDATE_FAILED;
+ krb5_free_context(context);
return(GSS_S_CALL_BAD_STRUCTURE|GSS_S_DEFECTIVE_CREDENTIAL);
}
cred = (krb5_gss_cred_id_t) cred_handle;
-
+
if (cred->ccache) {
if ((code = krb5_cc_get_principal(context, cred->ccache, &princ))) {
*minor_status = code;
+ krb5_free_context(context);
return(GSS_S_DEFECTIVE_CREDENTIAL);
}
if (!krb5_principal_compare(context, princ, cred->princ)) {
*minor_status = KG_CCACHE_NOMATCH;
+ krb5_free_context(context);
return(GSS_S_DEFECTIVE_CREDENTIAL);
}
(void)krb5_free_principal(context, princ);
}
+ krb5_free_context(context);
*minor_status = 0;
return GSS_S_COMPLETE;
}