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_error_code
|
||||||
krb5_mk_req(krb5_context context,
|
krb5_mk_req(krb5_context context,
|
||||||
krb5_auth_context **auth_context,
|
krb5_auth_context *auth_context,
|
||||||
const krb5_flags ap_req_options,
|
const krb5_flags ap_req_options,
|
||||||
char *service,
|
char *service,
|
||||||
char *hostname,
|
char *hostname,
|
||||||
@@ -12,12 +12,12 @@ krb5_mk_req(krb5_context context,
|
|||||||
krb5_data *outbuf)
|
krb5_data *outbuf)
|
||||||
{
|
{
|
||||||
krb5_error_code r;
|
krb5_error_code r;
|
||||||
krb5_creds this_cred, cred;
|
krb5_creds this_cred, *cred;
|
||||||
char **realms;
|
char **realms;
|
||||||
Authenticator *auth;
|
Authenticator *auth;
|
||||||
krb5_data realm_data, authenticator;
|
krb5_data realm_data, authenticator;
|
||||||
|
|
||||||
if (*auth_context == NULL) {
|
if (auth_context == NULL) {
|
||||||
r = krb5_auth_con_init(context, auth_context);
|
r = krb5_auth_con_init(context, auth_context);
|
||||||
if (r)
|
if (r)
|
||||||
return r;
|
return r;
|
||||||
@@ -29,6 +29,11 @@ krb5_mk_req(krb5_context context,
|
|||||||
realm_data.length = strlen(*realms);
|
realm_data.length = strlen(*realms);
|
||||||
realm_data.data = *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,
|
r = krb5_build_principal (context, &this_cred.server,
|
||||||
strlen(*realms),
|
strlen(*realms),
|
||||||
*realms,
|
*realms,
|
||||||
@@ -43,12 +48,12 @@ krb5_mk_req(krb5_context context,
|
|||||||
if (r)
|
if (r)
|
||||||
return r;
|
return r;
|
||||||
|
|
||||||
(*auth_context)->key.keytype = cred.session.keytype;
|
(*auth_context)->key.keytype = cred->session.keytype;
|
||||||
krb5_data_copy (&(*auth_context)->key.contents,
|
krb5_data_copy (&(*auth_context)->key.contents,
|
||||||
cred.session.contents.data,
|
cred->session.contents.data,
|
||||||
cred.session.contents.length);
|
cred->session.contents.length);
|
||||||
|
|
||||||
r = krb5_build_authenticator (context, cred.client,
|
r = krb5_build_authenticator (context, cred->client,
|
||||||
NULL, &auth,
|
NULL, &auth,
|
||||||
&authenticator);
|
&authenticator);
|
||||||
if (r)
|
if (r)
|
||||||
@@ -57,7 +62,7 @@ krb5_mk_req(krb5_context context,
|
|||||||
(*auth_context)->authenticator->cusec = auth->cusec;
|
(*auth_context)->authenticator->cusec = auth->cusec;
|
||||||
(*auth_context)->authenticator->ctime = auth->ctime;
|
(*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);
|
authenticator, outbuf);
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user