summaryrefslogtreecommitdiff
path: root/source4/heimdal/lib/krb5/get_cred.c
diff options
context:
space:
mode:
Diffstat (limited to 'source4/heimdal/lib/krb5/get_cred.c')
-rw-r--r--source4/heimdal/lib/krb5/get_cred.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/source4/heimdal/lib/krb5/get_cred.c b/source4/heimdal/lib/krb5/get_cred.c
index 63152bbfa6..7072137338 100644
--- a/source4/heimdal/lib/krb5/get_cred.c
+++ b/source4/heimdal/lib/krb5/get_cred.c
@@ -244,16 +244,12 @@ init_tgs_req (krb5_context context,
if(ret)
goto fail;
- ret = krb5_generate_subkey_extended(context, &krbtgt->session,
- ETYPE_NULL, &key);
+ ret = krb5_auth_con_generatelocalsubkey(context, ac, &krbtgt->session);
if (ret)
goto fail;
- ret = krb5_auth_con_setlocalsubkey(context, ac, key);
- if (ret)
- goto fail;
-
- ret = set_auth_data (context, &t->req_body, &in_creds->authdata, key);
+ ret = set_auth_data (context, &t->req_body, &in_creds->authdata,
+ ac->local_subkey);
if (ret)
goto fail;
@@ -265,12 +261,11 @@ init_tgs_req (krb5_context context,
if(ret)
goto fail;
- *subkey = key;
- key = NULL;
-
+ ret = krb5_auth_con_getlocalsubkey(context, ac, subkey);
+ if (ret)
+ goto fail;
+
fail:
- if (key)
- krb5_free_keyblock (context, key);
if (ac)
krb5_auth_con_free(context, ac);
if (ret) {