Get client from cache.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@1140 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
|
||||
krb5_error_code
|
||||
krb5_mk_req(krb5_context context,
|
||||
krb5_auth_context **auth_context,
|
||||
krb5_auth_context *auth_context,
|
||||
const krb5_flags ap_req_options,
|
||||
char *service,
|
||||
char *hostname,
|
||||
@@ -12,15 +12,15 @@ krb5_mk_req(krb5_context context,
|
||||
krb5_data *outbuf)
|
||||
{
|
||||
krb5_error_code r;
|
||||
krb5_creds this_cred, cred;
|
||||
krb5_creds this_cred, *cred;
|
||||
char **realms;
|
||||
Authenticator *auth;
|
||||
krb5_data realm_data, authenticator;
|
||||
|
||||
if (*auth_context == NULL) {
|
||||
r = krb5_auth_con_init(context, auth_context);
|
||||
if (r)
|
||||
return r;
|
||||
if (auth_context == NULL) {
|
||||
r = krb5_auth_con_init(context, auth_context);
|
||||
if (r)
|
||||
return r;
|
||||
}
|
||||
|
||||
r = krb5_get_host_realm(context, hostname, &realms);
|
||||
@@ -29,6 +29,11 @@ krb5_mk_req(krb5_context context,
|
||||
realm_data.length = strlen(*realms);
|
||||
realm_data.data = *realms;
|
||||
|
||||
r = krb5_cc_get_principal(context, ccache, &this_cred.client);
|
||||
|
||||
if(r)
|
||||
return r;
|
||||
|
||||
r = krb5_build_principal (context, &this_cred.server,
|
||||
strlen(*realms),
|
||||
*realms,
|
||||
@@ -43,12 +48,12 @@ krb5_mk_req(krb5_context context,
|
||||
if (r)
|
||||
return r;
|
||||
|
||||
(*auth_context)->key.keytype = cred.session.keytype;
|
||||
(*auth_context)->key.keytype = cred->session.keytype;
|
||||
krb5_data_copy (&(*auth_context)->key.contents,
|
||||
cred.session.contents.data,
|
||||
cred.session.contents.length);
|
||||
cred->session.contents.data,
|
||||
cred->session.contents.length);
|
||||
|
||||
r = krb5_build_authenticator (context, cred.client,
|
||||
r = krb5_build_authenticator (context, cred->client,
|
||||
NULL, &auth,
|
||||
&authenticator);
|
||||
if (r)
|
||||
@@ -57,7 +62,7 @@ krb5_mk_req(krb5_context context,
|
||||
(*auth_context)->authenticator->cusec = auth->cusec;
|
||||
(*auth_context)->authenticator->ctime = auth->ctime;
|
||||
|
||||
r = krb5_build_ap_req (context, &cred, ap_req_options,
|
||||
r = krb5_build_ap_req (context, cred, ap_req_options,
|
||||
authenticator, outbuf);
|
||||
return r;
|
||||
}
|
||||
|
Reference in New Issue
Block a user