1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

auth: make auth4_context common to provide access to generate_session_info_pac()

By providing this context, a function pointer for
generate_session_info_pac() can be inserted into gensec, allowing the
s3 PAC processing in an otherwise more generic gensec module.

Andrew Bartlett

Signed-off-by: Stefan Metzmacher <metze@samba.org>
This commit is contained in:
Andrew Bartlett 2011-12-31 22:45:51 +11:00 committed by Stefan Metzmacher
parent b213514631
commit 14c8a13d3e
2 changed files with 59 additions and 52 deletions

View File

@ -65,4 +65,63 @@ struct auth_usersupplied_info
uint32_t flags;
};
struct auth_method_context;
struct tevent_context;
struct imessaging_context;
struct loadparm_context;
struct ldb_context;
struct smb_krb5_context;
struct auth4_context {
struct {
/* Who set this up in the first place? */
const char *set_by;
bool may_be_modified;
DATA_BLOB data;
} challenge;
/* methods, in the order they should be called */
struct auth_method_context *methods;
/* the event context to use for calls that can block */
struct tevent_context *event_ctx;
/* the messaging context which can be used by backends */
struct imessaging_context *msg_ctx;
/* loadparm context */
struct loadparm_context *lp_ctx;
/* SAM database for this local machine - to fill in local groups, or to authenticate local NTLM users */
struct ldb_context *sam_ctx;
NTSTATUS (*check_password)(struct auth4_context *auth_ctx,
TALLOC_CTX *mem_ctx,
const struct auth_usersupplied_info *user_info,
struct auth_user_info_dc **user_info_dc);
NTSTATUS (*get_challenge)(struct auth4_context *auth_ctx, uint8_t chal[8]);
bool (*challenge_may_be_modified)(struct auth4_context *auth_ctx);
NTSTATUS (*set_challenge)(struct auth4_context *auth_ctx, const uint8_t chal[8], const char *set_by);
NTSTATUS (*generate_session_info)(TALLOC_CTX *mem_ctx,
struct auth4_context *auth_context,
struct auth_user_info_dc *user_info_dc,
uint32_t session_info_flags,
struct auth_session_info **session_info);
NTSTATUS (*generate_session_info_pac)(struct auth4_context *auth_ctx,
TALLOC_CTX *mem_ctx,
struct smb_krb5_context *smb_krb5_context,
DATA_BLOB *pac_blob,
const char *principal_name,
const struct tsocket_address *remote_address,
uint32_t session_info_flags,
struct auth_session_info **session_info);
};
#endif

View File

@ -94,58 +94,6 @@ struct auth_method_context {
void *private_data;
};
struct auth4_context {
struct {
/* Who set this up in the first place? */
const char *set_by;
bool may_be_modified;
DATA_BLOB data;
} challenge;
/* methods, in the order they should be called */
struct auth_method_context *methods;
/* the event context to use for calls that can block */
struct tevent_context *event_ctx;
/* the messaging context which can be used by backends */
struct imessaging_context *msg_ctx;
/* loadparm context */
struct loadparm_context *lp_ctx;
/* SAM database for this local machine - to fill in local groups, or to authenticate local NTLM users */
struct ldb_context *sam_ctx;
NTSTATUS (*check_password)(struct auth4_context *auth_ctx,
TALLOC_CTX *mem_ctx,
const struct auth_usersupplied_info *user_info,
struct auth_user_info_dc **user_info_dc);
NTSTATUS (*get_challenge)(struct auth4_context *auth_ctx, uint8_t chal[8]);
bool (*challenge_may_be_modified)(struct auth4_context *auth_ctx);
NTSTATUS (*set_challenge)(struct auth4_context *auth_ctx, const uint8_t chal[8], const char *set_by);
NTSTATUS (*generate_session_info)(TALLOC_CTX *mem_ctx,
struct auth4_context *auth_context,
struct auth_user_info_dc *user_info_dc,
uint32_t session_info_flags,
struct auth_session_info **session_info);
NTSTATUS (*generate_session_info_pac)(struct auth4_context *auth_ctx,
TALLOC_CTX *mem_ctx,
struct smb_krb5_context *smb_krb5_context,
DATA_BLOB *pac_blob,
const char *principal_name,
const struct tsocket_address *remote_address,
uint32_t session_info_flags,
struct auth_session_info **session_info);
};
/* this structure is used by backends to determine the size of some critical types */
struct auth_critical_sizes {
int interface_version;