From abbeb5c2175ad9574d75e852c101887d6e642cb4 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Mon, 13 Dec 2021 08:31:49 +0100 Subject: [PATCH] s4:mitkdc: Call krb5_pac_init() in kdb_samba_db_sign_auth_data() Signed-off-by: Andreas Schneider Reviewed-by: Andrew Bartlett --- source4/kdc/mit-kdb/kdb_samba_policies.c | 11 +++++++++++ source4/kdc/mit_samba.c | 6 ------ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/source4/kdc/mit-kdb/kdb_samba_policies.c b/source4/kdc/mit-kdb/kdb_samba_policies.c index 2d3bed8c4f4..793fe366c35 100644 --- a/source4/kdc/mit-kdb/kdb_samba_policies.c +++ b/source4/kdc/mit-kdb/kdb_samba_policies.c @@ -428,6 +428,12 @@ krb5_error_code kdb_samba_db_sign_auth_data(krb5_context context, */ if (with_pac && generate_pac) { DBG_DEBUG("Generate PAC for AS-REQ [%s]\n", client_name); + + code = krb5_pac_init(context, &pac); + if (code != 0) { + goto done; + } + code = ks_get_pac(context, client_entry, server, @@ -481,6 +487,11 @@ krb5_error_code kdb_samba_db_sign_auth_data(krb5_context context, "delegation TGS [%s]\n", client_name); + code = krb5_pac_init(context, &pac); + if (code != 0) { + goto done; + } + code = ks_get_pac(context, client_entry, server, diff --git a/source4/kdc/mit_samba.c b/source4/kdc/mit_samba.c index 3cc015aefb6..2beccfa3678 100644 --- a/source4/kdc/mit_samba.c +++ b/source4/kdc/mit_samba.c @@ -501,12 +501,6 @@ int mit_samba_get_pac(struct mit_samba_context *smb_ctx, pcred_blob = &cred_blob; } - code = krb5_pac_init(context, pac); - if (code != 0) { - talloc_free(tmp_ctx); - return code; - } - code = samba_make_krb5_pac(context, logon_info_blob, pcred_blob,