s4:rpc_server: remove unused dcesrv_connection_context->private_date
[samba.git] / auth / ntlmssp / ntlmssp.h
index 0d6a64e68ff33eeff1e3a177e8aea58a700be81c..658d3fa86afe7989006819a43745ba120fc0e4cc 100644 (file)
@@ -62,7 +62,9 @@ struct ntlmssp_state
        bool unicode;
        bool use_ntlmv2;
        bool use_ccache;
+       bool resume_ccache;
        bool use_nt_response;  /* Set to 'False' to debug what happens when the NT response is omited */
+       bool allow_lm_response;/* The LM_RESPONSE code is not very secure... */
        bool allow_lm_key;     /* The LM_KEY code is not very secure... */
 
        const char *user;
@@ -70,9 +72,15 @@ struct ntlmssp_state
        uint8_t *nt_hash;
        uint8_t *lm_hash;
 
+       DATA_BLOB negotiate_blob;
+       DATA_BLOB challenge_blob;
+       bool new_spnego;
+       bool force_old_spnego;
+
        struct {
                const char *netbios_name;
                const char *netbios_domain;
+               struct AV_PAIR_LIST av_pair_list;
        } client;
 
        struct {
@@ -81,6 +89,8 @@ struct ntlmssp_state
                const char *netbios_domain;
                const char *dns_name;
                const char *dns_domain;
+               NTTIME challenge_endtime;
+               struct AV_PAIR_LIST av_pair_list;
        } server;
 
        DATA_BLOB internal_chal; /* Random challenge as supplied to the client for NTLM authentication */
@@ -90,59 +100,11 @@ struct ntlmssp_state
        DATA_BLOB nt_resp;
        DATA_BLOB session_key;
 
+       uint32_t conf_flags;
+       uint32_t required_flags;
        uint32_t neg_flags; /* the current state of negotiation with the NTLMSSP partner */
 
-       /**
-        * Private data for the callback functions
-        */
-       void *callback_private;
-
-       /**
-        * Callback to get the 'challenge' used for NTLM authentication.
-        *
-        * @param ntlmssp_state This structure
-        * @return 8 bytes of challenge data, determined by the server to be the challenge for NTLM authentication
-        *
-        */
-       NTSTATUS (*get_challenge)(const struct ntlmssp_state *ntlmssp_state,
-                                 uint8_t challenge[8]);
-
-       /**
-        * Callback to find if the challenge used by NTLM authentication may be modified
-        *
-        * The NTLM2 authentication scheme modifies the effective challenge, but this is not compatiable with the
-        * current 'security=server' implementation..
-        *
-        * @param ntlmssp_state This structure
-        * @return Can the challenge be set to arbitary values?
-        *
-        */
-       bool (*may_set_challenge)(const struct ntlmssp_state *ntlmssp_state);
-
-       /**
-        * Callback to set the 'challenge' used for NTLM authentication.
-        *
-        * The callback may use the void *auth_context to store state information, but the same value is always available
-        * from the DATA_BLOB chal on this structure.
-        *
-        * @param ntlmssp_state This structure
-        * @param challenge 8 bytes of data, agreed by the client and server to be the effective challenge for NTLM2 authentication
-        *
-        */
-       NTSTATUS (*set_challenge)(struct ntlmssp_state *ntlmssp_state, DATA_BLOB *challenge);
-
-       /**
-        * Callback to check the user's password.
-        *
-        * The callback must reads the feilds of this structure for the information it needs on the user
-        * @param ntlmssp_state This structure
-        * @param mem_ctx Talloc context for LM and NT session key to be returned on
-        * @param nt_session_key If an NT session key is returned by the authentication process, return it here
-        * @param lm_session_key If an LM session key is returned by the authentication process, return it here
-        *
-        */
-       NTSTATUS (*check_password)(struct ntlmssp_state *ntlmssp_state, TALLOC_CTX *mem_ctx,
-                                  DATA_BLOB *nt_session_key, DATA_BLOB *lm_session_key);
+       bool force_wrap_seal;
 
        union ntlmssp_crypt_state *crypt;
 };
@@ -175,10 +137,15 @@ NTSTATUS ntlmssp_unwrap(struct ntlmssp_state *ntlmssp_stae,
                        TALLOC_CTX *out_mem_ctx,
                        const DATA_BLOB *in,
                        DATA_BLOB *out);
+NTSTATUS ntlmssp_sign_reset(struct ntlmssp_state *ntlmssp_state,
+                           bool reset_seqnums);
 NTSTATUS ntlmssp_sign_init(struct ntlmssp_state *ntlmssp_state);
 
 bool ntlmssp_blob_matches_magic(const DATA_BLOB *blob);
 
 /* The following definitions come from auth/ntlmssp/gensec_ntlmssp.c  */
 
-NTSTATUS gensec_ntlmssp_init(void);
+NTSTATUS gensec_ntlmssp_init(TALLOC_CTX *ctx);
+
+uint32_t gensec_ntlmssp_neg_flags(struct gensec_security *gensec_security);
+const char *gensec_ntlmssp_server_domain(struct gensec_security *gensec_security);