From: Nick Porter Date: Tue, 3 Dec 2024 10:52:32 +0000 (+0000) Subject: Pass auth_ctx to do_auth_wbclient() X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d9981399fc0a5934f45666869f078c7d072bb4e6;p=thirdparty%2Ffreeradius-server.git Pass auth_ctx to do_auth_wbclient() --- diff --git a/src/modules/rlm_mschap/auth_wbclient.c b/src/modules/rlm_mschap/auth_wbclient.c index 4830fdc165a..db6ca66e1b2 100644 --- a/src/modules/rlm_mschap/auth_wbclient.c +++ b/src/modules/rlm_mschap/auth_wbclient.c @@ -92,7 +92,7 @@ static char *wbclient_normalise_username(TALLOC_CTX *ctx, struct wbcContext *wb_ */ int do_auth_wbclient(rlm_mschap_t const *inst, request_t *request, uint8_t const *challenge, uint8_t const *response, - uint8_t nthashhash[NT_DIGEST_LENGTH], mschap_auth_call_env_t *env_data) + uint8_t nthashhash[NT_DIGEST_LENGTH], mschap_auth_ctx_t *auth_ctx) { int ret = -1; struct wbcContext *wb_ctx = NULL; @@ -101,6 +101,7 @@ int do_auth_wbclient(rlm_mschap_t const *inst, request_t *request, struct wbcAuthUserInfo *info = NULL; struct wbcAuthErrorInfo *error = NULL; uint8_t resp[NT_LENGTH]; + mschap_auth_call_env_t *env_data = auth_ctx->env_data; /* * Clear the auth parameters - this is important, as diff --git a/src/modules/rlm_mschap/auth_wbclient.h b/src/modules/rlm_mschap/auth_wbclient.h index 610ab3e5dab..04e20a8c07a 100644 --- a/src/modules/rlm_mschap/auth_wbclient.h +++ b/src/modules/rlm_mschap/auth_wbclient.h @@ -5,4 +5,4 @@ RCSIDH(auth_wbclient_h, "$Id$") int do_auth_wbclient(rlm_mschap_t const *inst, request_t *request, uint8_t const *challenge, uint8_t const *response, uint8_t nthashhash[NT_DIGEST_LENGTH], - mschap_auth_call_env_t *env_data); + mschap_auth_ctx_t *auth_ctx); diff --git a/src/modules/rlm_mschap/rlm_mschap.c b/src/modules/rlm_mschap/rlm_mschap.c index cc6bc4c760e..c09a15a5f27 100644 --- a/src/modules/rlm_mschap/rlm_mschap.c +++ b/src/modules/rlm_mschap/rlm_mschap.c @@ -48,7 +48,6 @@ RCSID("$Id$") #include #include "rlm_mschap.h" -#include "mschap.h" #include "smbdes.h" #ifdef WITH_AUTH_WINBIND @@ -213,26 +212,6 @@ static const call_env_parser_t autz_call_env[] = { MSCHAP_CALL_ENV(autz); -typedef struct { - fr_value_box_list_t cpw_user; - fr_value_box_list_t cpw_domain; - fr_value_box_list_t local_cpw_result; - uint8_t new_nt_encrypted[516]; - uint8_t old_nt_hash[NT_DIGEST_LENGTH]; - fr_pair_t *new_hash; -} mschap_cpw_ctx_t; - -typedef struct { - char const *name; - rlm_mschap_t const *inst; - mschap_auth_call_env_t *env_data; - MSCHAP_AUTH_METHOD method; - fr_pair_t *nt_password; - fr_pair_t *smb_ctrl; - fr_pair_t *cpw; - mschap_cpw_ctx_t *cpw_ctx; -} mschap_auth_ctx_t; - static fr_dict_t const *dict_freeradius; static fr_dict_t const *dict_radius; diff --git a/src/modules/rlm_mschap/rlm_mschap.h b/src/modules/rlm_mschap/rlm_mschap.h index 21ccb9790db..80473919ebb 100644 --- a/src/modules/rlm_mschap/rlm_mschap.h +++ b/src/modules/rlm_mschap/rlm_mschap.h @@ -3,6 +3,7 @@ RCSIDH(rlm_mschap_h, "$Id$") #include "config.h" +#include "mschap.h" #include #include @@ -85,3 +86,26 @@ typedef struct { tmpl_t const *ntlm_cpw_domain; tmpl_t const *local_cpw; } mschap_auth_call_env_t; + +typedef struct { + fr_value_box_list_t cpw_user; + fr_value_box_list_t cpw_domain; + fr_value_box_list_t local_cpw_result; + uint8_t new_nt_encrypted[516]; + uint8_t old_nt_hash[NT_DIGEST_LENGTH]; + fr_pair_t *new_hash; +} mschap_cpw_ctx_t; + +typedef struct { + char const *name; + rlm_mschap_t const *inst; + mschap_auth_call_env_t *env_data; + MSCHAP_AUTH_METHOD method; + fr_pair_t *nt_password; + fr_pair_t *smb_ctrl; + fr_pair_t *cpw; + mschap_cpw_ctx_t *cpw_ctx; +#ifdef WITH_AUTH_WINBIND + rlm_mschap_thread_t *t; +#endif +} mschap_auth_ctx_t;