s4:kdc: let pac functions in wdc-samba4.c take astgs_request_t
authorStefan Metzmacher <metze@samba.org>
Thu, 24 Feb 2022 20:31:52 +0000 (21:31 +0100)
committerAndrew Bartlett <abartlet@samba.org>
Sun, 6 Mar 2022 23:05:40 +0000 (23:05 +0000)
NOTE: This commit finally works again!

This aligns us with the following Heimdal change:

   commit 11d8a053f50c88256b4d49c7e482c2eb8f6bde33
   Author:     Stefan Metzmacher <metze@samba.org>
   AuthorDate: Thu Feb 24 18:27:09 2022 +0100
   Commit:     Luke Howard <lukeh@padl.com>
   CommitDate: Thu Mar 3 09:58:48 2022 +1100

       kdc-plugin: also pass astgs_request_t to the pac related functions

       This is more consistent and allows the pac hooks to be more flexible.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14865

Signed-off-by: Stefan Metzmacher <metze@samba.org>
source4/kdc/wdc-samba4.c

index dfca27175a21813679c2eb25542676dd2730e1ba..7f99233440e77b9cb681b34ef130533cea30eb92 100644 (file)
  *
  * For PKINIT we also get pk_reply_key and can add PAC_CREDENTIAL_INFO.
  */
-static krb5_error_code samba_wdc_get_pac(void *priv, krb5_context context,
-                                        krb5_kdc_configuration *config,
+static krb5_error_code samba_wdc_get_pac(void *priv,
+                                        astgs_request_t r,
                                         hdb_entry *client,
                                         hdb_entry *server,
                                         const krb5_keyblock *pk_reply_key,
                                         uint64_t pac_attributes,
                                         krb5_pac *pac)
 {
+       krb5_context context = kdc_request_get_context((kdc_request_t)r);
        TALLOC_CTX *mem_ctx;
        DATA_BLOB *logon_blob = NULL;
        DATA_BLOB *cred_ndr = NULL;
@@ -663,8 +664,7 @@ out:
 
 /* Resign (and reform, including possibly new groups) a PAC */
 
-static krb5_error_code samba_wdc_reget_pac(void *priv, krb5_context context,
-                                          krb5_kdc_configuration *config,
+static krb5_error_code samba_wdc_reget_pac(void *priv, astgs_request_t r,
                                           const krb5_principal client_principal,
                                           const krb5_principal delegated_proxy_principal,
                                           hdb_entry *client,
@@ -672,6 +672,8 @@ static krb5_error_code samba_wdc_reget_pac(void *priv, krb5_context context,
                                           hdb_entry *krbtgt,
                                           krb5_pac *pac)
 {
+       krb5_context context = kdc_request_get_context((kdc_request_t)r);
+       krb5_kdc_configuration *config = kdc_request_get_config((kdc_request_t)r);
        struct samba_kdc_entry *krbtgt_skdc_entry =
                talloc_get_type_abort(krbtgt->context,
                                      struct samba_kdc_entry);