Make an auth_context if none passed in.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@2412 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -54,22 +54,26 @@ krb5_mk_req_extended(krb5_context context,
|
|||||||
Checksum c;
|
Checksum c;
|
||||||
Checksum *c_opt;
|
Checksum *c_opt;
|
||||||
|
|
||||||
if (*auth_context == NULL) {
|
krb5_auth_context ac;
|
||||||
r = krb5_auth_con_init(context, auth_context);
|
if(auth_context){
|
||||||
if (r)
|
if(*auth_context == NULL)
|
||||||
return r;
|
r = krb5_auth_con_init(context, auth_context);
|
||||||
}
|
ac = *auth_context;
|
||||||
|
}else
|
||||||
|
r = krb5_auth_con_init(context, &ac);
|
||||||
|
if(r)
|
||||||
|
return r;
|
||||||
|
|
||||||
copy_EncryptionKey(&in_creds->session,
|
copy_EncryptionKey(&in_creds->session,
|
||||||
&(*auth_context)->key);
|
&ac->key);
|
||||||
|
|
||||||
if (in_data) {
|
if (in_data) {
|
||||||
|
|
||||||
r = krb5_create_checksum (context,
|
r = krb5_create_checksum (context,
|
||||||
(*auth_context)->cksumtype,
|
ac->cksumtype,
|
||||||
in_data->data,
|
in_data->data,
|
||||||
in_data->length,
|
in_data->length,
|
||||||
&(*auth_context)->key,
|
&ac->key,
|
||||||
&c);
|
&c);
|
||||||
c_opt = &c;
|
c_opt = &c;
|
||||||
} else {
|
} else {
|
||||||
@@ -77,7 +81,7 @@ krb5_mk_req_extended(krb5_context context,
|
|||||||
}
|
}
|
||||||
|
|
||||||
r = krb5_build_authenticator (context,
|
r = krb5_build_authenticator (context,
|
||||||
*auth_context,
|
ac,
|
||||||
in_creds,
|
in_creds,
|
||||||
c_opt,
|
c_opt,
|
||||||
&auth,
|
&auth,
|
||||||
@@ -87,5 +91,7 @@ krb5_mk_req_extended(krb5_context context,
|
|||||||
|
|
||||||
r = krb5_build_ap_req (context, in_creds, ap_req_options,
|
r = krb5_build_ap_req (context, in_creds, ap_req_options,
|
||||||
authenticator, outbuf);
|
authenticator, outbuf);
|
||||||
|
if(auth_context == NULL)
|
||||||
|
krb5_auth_con_free(context, ac);
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user