summaryrefslogtreecommitdiffstats
path: root/src/lib/gssapi/krb5/val_cred.c
diff options
context:
space:
mode:
authorKen Raeburn <raeburn@mit.edu>2004-03-21 02:09:21 +0000
committerKen Raeburn <raeburn@mit.edu>2004-03-21 02:09:21 +0000
commit45e076609c6ac5e59e6ad26736f807cff3e27513 (patch)
tree28f56a5229ac4177e1f5ef0894be7fc919365b39 /src/lib/gssapi/krb5/val_cred.c
parent115c489c9af46ade474b7653f2a4a6131b38da83 (diff)
downloadkrb5-45e076609c6ac5e59e6ad26736f807cff3e27513.tar.gz
krb5-45e076609c6ac5e59e6ad26736f807cff3e27513.tar.xz
krb5-45e076609c6ac5e59e6ad26736f807cff3e27513.zip
* 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. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16196 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/lib/gssapi/krb5/val_cred.c')
-rw-r--r--src/lib/gssapi/krb5/val_cred.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/lib/gssapi/krb5/val_cred.c b/src/lib/gssapi/krb5/val_cred.c
index aea1765bc2..fef8480440 100644
--- a/src/lib/gssapi/krb5/val_cred.c
+++ b/src/lib/gssapi/krb5/val_cred.c
@@ -40,27 +40,34 @@ krb5_gss_validate_cred(minor_status, cred_handle)
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;
}