s3-auth: Remove protype for already-removed auth_ntlmssp_start
[ddiss/samba.git] / source3 / auth / proto.h
index 585c413c14b24ab7f1e100c1c4662bccd458a3cd..074da79a056bda4c69ea9ed0fc09632edf13fea4 100644 (file)
@@ -1,3 +1,37 @@
+/*
+ *  Unix SMB/CIFS implementation.
+ *  Password and authentication handling
+ *
+ *  Copyright (C) Andrew Tridgell              1992-2001
+ *  Copyright (C) Luke Kenneth Casson Leighton 1996-2000
+ *  Copyright (C) Jeremy Allison               1997-2001
+ *  Copyright (C) John H Terpsta               1999-2001
+ *  Copyright (C) Tim Potter                   2000
+ *  Copyright (C) Andrew Bartlett              2001-2003
+ *  Copyright (C) Jelmer Vernooij              2002
+ *  Copyright (C) Rafal Szczesniak             2002
+ *  Copyright (C) Gerald Carter                        2003
+ *  Copyright (C) Volker Lendecke              2006,2010
+ *  Copyright (C) Michael Adam                 2007
+ *  Copyright (C) Dan Sledz                    2009
+ *  Copyright (C) Simo Sorce                   2010
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef _AUTH_PROTO_H_
+#define _AUTH_PROTO_H_
 
 /* The following definitions come from auth/auth.c  */
 
@@ -17,11 +51,14 @@ NTSTATUS auth_builtin_init(void);
 /* The following definitions come from auth/auth_compat.c  */
 
 NTSTATUS check_plaintext_password(const char *smb_name,
+                                 const struct tsocket_address *remote_address,
                                  DATA_BLOB plaintext_password,
                                  struct auth_serversupplied_info **server_info);
 bool password_ok(struct auth_context *actx, bool global_encrypted,
                 const char *session_workgroup,
-                const char *smb_name, DATA_BLOB password_blob);
+                const char *smb_name,
+                const struct tsocket_address *remote_address,
+                DATA_BLOB password_blob);
 
 /* The following definitions come from auth/auth_domain.c  */
 
@@ -32,10 +69,11 @@ NTSTATUS auth_netlogond_init(void);
 
 /* The following definitions come from auth/auth_ntlmssp.c  */
 
-NTSTATUS auth_ntlmssp_steal_session_info(TALLOC_CTX *mem_ctx,
-                               struct auth_ntlmssp_state *auth_ntlmssp_state,
-                               struct auth_serversupplied_info **session_info);
-NTSTATUS auth_ntlmssp_start(struct auth_ntlmssp_state **auth_ntlmssp_state);
+NTSTATUS auth_generic_prepare(const struct tsocket_address *remote_address,
+                             struct auth_generic_state **auth_ntlmssp_state);
+NTSTATUS auth_generic_start(struct auth_generic_state *auth_ntlmssp_state, const char *oid);
+NTSTATUS auth_generic_authtype_start(struct auth_generic_state *auth_ntlmssp_state, 
+                                    uint8_t auth_type, uint8_t auth_level);
 
 
 /* The following definitions come from auth/auth_sam.c  */
@@ -59,11 +97,13 @@ NTSTATUS auth_server_init(void);
 NTSTATUS auth_unix_init(void);
 
 /* The following definitions come from auth/auth_util.c  */
+struct tsocket_address;
 
 NTSTATUS make_user_info_map(struct auth_usersupplied_info **user_info,
                            const char *smb_name,
                            const char *client_domain,
                            const char *workstation_name,
+                           const struct tsocket_address *remote_address,
                            DATA_BLOB *lm_pwd,
                            DATA_BLOB *nt_pwd,
                            const struct samr_Password *lm_interactive_pwd,
@@ -74,6 +114,7 @@ bool make_user_info_netlogon_network(struct auth_usersupplied_info **user_info,
                                     const char *smb_name,
                                     const char *client_domain,
                                     const char *workstation_name,
+                                    const struct tsocket_address *remote_address,
                                     uint32 logon_parameters,
                                     const uchar *lm_network_pwd,
                                     int lm_pwd_len,
@@ -83,6 +124,7 @@ bool make_user_info_netlogon_interactive(struct auth_usersupplied_info **user_in
                                         const char *smb_name,
                                         const char *client_domain,
                                         const char *workstation_name,
+                                        const struct tsocket_address *remote_address,
                                         uint32 logon_parameters,
                                         const uchar chal[8],
                                         const uchar lm_interactive_pwd[16],
@@ -91,17 +133,25 @@ bool make_user_info_netlogon_interactive(struct auth_usersupplied_info **user_in
 bool make_user_info_for_reply(struct auth_usersupplied_info **user_info,
                              const char *smb_name,
                              const char *client_domain,
+                             const struct tsocket_address *remote_address,
                              const uint8 chal[8],
                              DATA_BLOB plaintext_password);
 NTSTATUS make_user_info_for_reply_enc(struct auth_usersupplied_info **user_info,
                                       const char *smb_name,
                                       const char *client_domain,
+                                     const struct tsocket_address *remote_address,
                                       DATA_BLOB lm_resp, DATA_BLOB nt_resp);
-bool make_user_info_guest(struct auth_usersupplied_info **user_info) ;
+bool make_user_info_guest(const struct tsocket_address *remote_address,
+                         struct auth_usersupplied_info **user_info);
+
 struct samu;
 NTSTATUS make_server_info_sam(struct auth_serversupplied_info **server_info,
                              struct samu *sampass);
-NTSTATUS create_local_token(struct auth_serversupplied_info *server_info);
+NTSTATUS create_local_token(TALLOC_CTX *mem_ctx,
+                           const struct auth_serversupplied_info *server_info,
+                           DATA_BLOB *session_key,
+                           const char *smb_name,
+                           struct auth_session_info **session_info_out);
 NTSTATUS create_token_from_username(TALLOC_CTX *mem_ctx, const char *username,
                                    bool is_guest,
                                    uid_t *uid, gid_t *gid,
@@ -113,21 +163,23 @@ struct passwd;
 NTSTATUS make_server_info_pw(struct auth_serversupplied_info **server_info,
                              char *unix_username,
                             struct passwd *pwd);
-NTSTATUS make_serverinfo_from_username(TALLOC_CTX *mem_ctx,
-                                      const char *username,
-                                      bool is_guest,
-                                      struct auth_serversupplied_info **presult);
-struct auth_serversupplied_info *copy_serverinfo(TALLOC_CTX *mem_ctx,
-                                                const struct auth_serversupplied_info *src);
+NTSTATUS make_session_info_from_username(TALLOC_CTX *mem_ctx,
+                                        const char *username,
+                                        bool is_guest,
+                                        struct auth_session_info **session_info);
+struct auth_session_info *copy_session_info(TALLOC_CTX *mem_ctx,
+                                            const struct auth_session_info *src);
 bool init_guest_info(void);
 NTSTATUS init_system_info(void);
-bool session_info_set_session_key(struct auth_serversupplied_info *info,
+bool session_info_set_session_key(struct auth_session_info *info,
                                 DATA_BLOB session_key);
 NTSTATUS make_server_info_guest(TALLOC_CTX *mem_ctx,
                                struct auth_serversupplied_info **server_info);
+NTSTATUS make_session_info_guest(TALLOC_CTX *mem_ctx,
+                               struct auth_session_info **server_info);
 NTSTATUS make_session_info_system(TALLOC_CTX *mem_ctx,
-                                struct auth_serversupplied_info **session_info);
-const struct auth_serversupplied_info *get_session_info_system(void);
+                                struct auth_session_info **session_info);
+const struct auth_session_info *get_session_info_system(void);
 bool copy_current_user(struct current_user *dst, struct current_user *src);
 struct passwd *smb_getpwnam( TALLOC_CTX *mem_ctx, const char *domuser,
                             char **p_save_username, bool create );
@@ -143,7 +195,6 @@ NTSTATUS make_server_info_wbcAuthUserInfo(TALLOC_CTX *mem_ctx,
                                          const struct wbcAuthUserInfo *info,
                                          struct auth_serversupplied_info **server_info);
 void free_user_info(struct auth_usersupplied_info **user_info);
-bool make_auth_methods(struct auth_context *auth_context, auth_methods **auth_method) ;
 bool is_trusted_domain(const char* dom_name);
 
 /* The following definitions come from auth/user_info.c  */
@@ -154,6 +205,7 @@ NTSTATUS make_user_info(struct auth_usersupplied_info **ret_user_info,
                        const char *client_domain,
                        const char *domain,
                        const char *workstation_name,
+                       const struct tsocket_address *remote_address,
                        const DATA_BLOB *lm_pwd,
                        const DATA_BLOB *nt_pwd,
                        const struct samr_Password *lm_interactive_pwd,
@@ -162,6 +214,10 @@ NTSTATUS make_user_info(struct auth_usersupplied_info **ret_user_info,
                        enum auth_password_state password_state);
 void free_user_info(struct auth_usersupplied_info **user_info);
 
+NTSTATUS do_map_to_guest_server_info(NTSTATUS status,
+                                    struct auth_serversupplied_info **server_info,
+                                    const char *user, const char *domain);
+
 /* The following definitions come from auth/auth_winbind.c  */
 
 NTSTATUS auth_winbind_init(void);
@@ -234,8 +290,8 @@ struct security_token *create_local_nt_token(TALLOC_CTX *mem_ctx,
                                            const struct dom_sid *groupsids);
 NTSTATUS create_local_nt_token_from_info3(TALLOC_CTX *mem_ctx,
                                          bool is_guest,
-                                         struct netr_SamInfo3 *info3,
-                                         struct extra_auth_info *extra,
+                                         const struct netr_SamInfo3 *info3,
+                                         const struct extra_auth_info *extra,
                                          struct security_token **ntok);
 void debug_unix_user_token(int dbg_class, int dbg_lev, uid_t uid, gid_t gid,
                           int n_groups, gid_t *groups);
@@ -243,6 +299,8 @@ void debug_unix_user_token(int dbg_class, int dbg_lev, uid_t uid, gid_t gid,
 /* The following definitions come from auth/user_util.c  */
 
 bool map_username(TALLOC_CTX *ctx, const char *user_in, char **p_user_out);
+bool user_in_netgroup(TALLOC_CTX *ctx, const char *user, const char *ngname);
+bool user_in_list(TALLOC_CTX *ctx, const char *user,const char **list);
 
 /* The following definitions come from auth/user_krb5.c  */
 struct PAC_LOGON_INFO;
@@ -256,11 +314,14 @@ NTSTATUS get_user_from_kerberos_info(TALLOC_CTX *mem_ctx,
                                     char **ntdomain,
                                     char **username,
                                     struct passwd **_pw);
-NTSTATUS make_server_info_krb5(TALLOC_CTX *mem_ctx,
+NTSTATUS make_session_info_krb5(TALLOC_CTX *mem_ctx,
                                char *ntuser,
                                char *ntdomain,
                                char *username,
                                struct passwd *pw,
                                struct PAC_LOGON_INFO *logon_info,
-                               bool mapped_to_guest,
-                               struct auth_serversupplied_info **server_info);
+                               bool mapped_to_guest, bool username_was_mapped,
+                               DATA_BLOB *session_key,
+                               struct auth_session_info **session_info);
+
+#endif /* _AUTH_PROTO_H_ */