Use krb5_mk_req rather than inlined code.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@1340 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -119,42 +119,29 @@ krb5_get_credentials (krb5_context context,
|
|||||||
a.req_body.enc_authorization_data = NULL;
|
a.req_body.enc_authorization_data = NULL;
|
||||||
|
|
||||||
{
|
{
|
||||||
|
krb5_data in_data;
|
||||||
unsigned char buf[1024];
|
unsigned char buf[1024];
|
||||||
|
krb5_auth_context ac = NULL;
|
||||||
int len;
|
int len;
|
||||||
Checksum c;
|
|
||||||
krb5_creds cred, mcred;
|
|
||||||
|
|
||||||
krb5_build_principal(context, &mcred.server,
|
|
||||||
in_creds->client->realm.length,
|
|
||||||
in_creds->client->realm.data,
|
|
||||||
"krbtgt", a.req_body.realm, NULL);
|
|
||||||
krb5_cc_retrieve_cred(context, ccache, 0, &mcred, &cred);
|
|
||||||
memcpy(&key, cred.session.contents.data, sizeof(key));
|
|
||||||
|
|
||||||
len = encode_KDC_REQ_BODY(buf + sizeof(buf) - 1, sizeof(buf),
|
len = encode_KDC_REQ_BODY(buf + sizeof(buf) - 1, sizeof(buf),
|
||||||
&a.req_body);
|
&a.req_body);
|
||||||
err = krb5_create_checksum (context,
|
in_data.length;
|
||||||
CKSUMTYPE_RSA_MD4,
|
in_data.data = buf + sizeof(buf) - len;
|
||||||
buf + sizeof(buf) - len,
|
|
||||||
len,
|
err = krb5_mk_req(context,
|
||||||
&c);
|
&ac,
|
||||||
if (err)
|
0,
|
||||||
return err;
|
"krbtgt",
|
||||||
err = krb5_build_authenticator (context, NULL,
|
a.req_body.realm,
|
||||||
&cred,
|
&in_data,
|
||||||
&c,
|
ccache,
|
||||||
NULL,
|
&foo.padata_value);
|
||||||
&authenticator);
|
if(err)
|
||||||
if (err)
|
return err;
|
||||||
return err;
|
|
||||||
|
|
||||||
foo.padata_type = pa_tgs_req;
|
foo.padata_type = pa_tgs_req;
|
||||||
err = krb5_build_ap_req(context, &cred,
|
|
||||||
0,
|
|
||||||
authenticator,
|
|
||||||
&foo.padata_value);
|
|
||||||
if(err)
|
|
||||||
return err;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
a.padata = malloc(sizeof(*a.padata));
|
a.padata = malloc(sizeof(*a.padata));
|
||||||
|
Reference in New Issue
Block a user