]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Pass auth_ctx to do_auth_wbclient()
authorNick Porter <nick@portercomputing.co.uk>
Tue, 3 Dec 2024 10:52:32 +0000 (10:52 +0000)
committerNick Porter <nick@portercomputing.co.uk>
Thu, 5 Dec 2024 10:32:09 +0000 (10:32 +0000)
src/modules/rlm_mschap/auth_wbclient.c
src/modules/rlm_mschap/auth_wbclient.h
src/modules/rlm_mschap/rlm_mschap.c
src/modules/rlm_mschap/rlm_mschap.h

index 4830fdc165af4b651b24ffb16ef4cc38db7ad38d..db6ca66e1b22e7dd55f26e96f0fb8a9ef6e80e29 100644 (file)
@@ -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
index 610ab3e5dabb825f4cfe28a704bfdf07a7ab3a9b..04e20a8c07a3ab8c1a8e85b17cbac9b640e6137f 100644 (file)
@@ -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);
index cc6bc4c760ef8de03ab13212819d61d26d776a6e..c09a15a5f27d05269bf53b329086f459a89931ae 100644 (file)
@@ -48,7 +48,6 @@ RCSID("$Id$")
 #include <sys/wait.h>
 
 #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;
 
index 21ccb9790db569957f79dadd7d50677ab2c7854d..80473919ebb4796cc4f6419930c70d803ec546d2 100644 (file)
@@ -3,6 +3,7 @@
 RCSIDH(rlm_mschap_h, "$Id$")
 
 #include "config.h"
+#include "mschap.h"
 
 #include <freeradius-devel/util/dict.h>
 #include <freeradius-devel/server/tmpl.h>
@@ -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;