2 Unix SMB/Netbios implementation.
4 handle NLTMSSP, client server side parsing
6 Copyright (C) Andrew Tridgell 2001
7 Copyright (C) Andrew Bartlett <abartlet@samba.org> 2001-2005
8 Copyright (C) Stefan Metzmacher 2005
10 This program is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation; either version 3 of the License, or
13 (at your option) any later version.
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
20 You should have received a copy of the GNU General Public License
21 along with this program. If not, see <http://www.gnu.org/licenses/>.
24 struct auth_session_info;
27 #include "auth/ntlmssp/ntlmssp.h"
28 #include "../lib/crypto/crypto.h"
29 #include "../libcli/auth/libcli_auth.h"
30 #include "auth/credentials/credentials.h"
31 #include "auth/gensec/gensec.h"
32 #include "auth/gensec/gensec_internal.h"
33 #include "param/param.h"
34 #include "auth/ntlmssp/ntlmssp_private.h"
35 #include "../librpc/gen_ndr/ndr_ntlmssp.h"
36 #include "../auth/ntlmssp/ntlmssp_ndr.h"
37 #include "../nsswitch/libwbclient/wbclient.h"
39 /*********************************************************************
41 *********************************************************************/
44 * Next state function for the Initial packet
46 * @param ntlmssp_state NTLMSSP State
47 * @param out_mem_ctx The DATA_BLOB *out will be allocated on this context
48 * @param in A NULL data blob (input ignored)
49 * @param out The initial negotiate request to the server, as an talloc()ed DATA_BLOB, on out_mem_ctx
50 * @return Errors or NT_STATUS_OK.
53 NTSTATUS ntlmssp_client_initial(struct gensec_security *gensec_security,
54 TALLOC_CTX *out_mem_ctx,
55 DATA_BLOB in, DATA_BLOB *out)
57 struct gensec_ntlmssp_context *gensec_ntlmssp =
58 talloc_get_type_abort(gensec_security->private_data,
59 struct gensec_ntlmssp_context);
60 struct ntlmssp_state *ntlmssp_state = gensec_ntlmssp->ntlmssp_state;
62 const DATA_BLOB version_blob = ntlmssp_version_blob();
64 /* generate the ntlmssp negotiate packet */
65 status = msrpc_gen(out_mem_ctx,
69 ntlmssp_state->neg_flags,
72 version_blob.data, version_blob.length);
73 if (!NT_STATUS_IS_OK(status)) {
74 DEBUG(0, ("ntlmssp_client_initial: failed to generate "
75 "ntlmssp negotiate packet\n"));
79 if (DEBUGLEVEL >= 10) {
80 struct NEGOTIATE_MESSAGE *negotiate = talloc(
81 ntlmssp_state, struct NEGOTIATE_MESSAGE);
82 if (negotiate != NULL) {
83 status = ntlmssp_pull_NEGOTIATE_MESSAGE(
84 out, negotiate, negotiate);
85 if (NT_STATUS_IS_OK(status)) {
86 NDR_PRINT_DEBUG(NEGOTIATE_MESSAGE,
89 TALLOC_FREE(negotiate);
93 ntlmssp_state->expected_state = NTLMSSP_CHALLENGE;
95 return NT_STATUS_MORE_PROCESSING_REQUIRED;
98 NTSTATUS gensec_ntlmssp_resume_ccache(struct gensec_security *gensec_security,
99 TALLOC_CTX *out_mem_ctx,
100 DATA_BLOB in, DATA_BLOB *out)
102 struct gensec_ntlmssp_context *gensec_ntlmssp =
103 talloc_get_type_abort(gensec_security->private_data,
104 struct gensec_ntlmssp_context);
105 struct ntlmssp_state *ntlmssp_state = gensec_ntlmssp->ntlmssp_state;
106 uint32_t neg_flags = 0;
107 uint32_t ntlmssp_command;
111 *out = data_blob_null;
113 if (in.length == 0) {
115 * This is compat code for older callers
116 * which were missing the "initial_blob"
118 ntlmssp_state->expected_state = NTLMSSP_CHALLENGE;
119 return NT_STATUS_MORE_PROCESSING_REQUIRED;
122 /* parse the NTLMSSP packet */
124 if (in.length > UINT16_MAX) {
125 DEBUG(1, ("%s: reject large request of length %u\n",
126 __func__, (unsigned int)in.length));
127 return NT_STATUS_INVALID_PARAMETER;
130 ok = msrpc_parse(ntlmssp_state, &in, "Cdd",
135 DEBUG(1, ("%s: failed to parse NTLMSSP Negotiate of length %u\n",
136 __func__, (unsigned int)in.length));
137 dump_data(2, in.data, in.length);
138 return NT_STATUS_INVALID_PARAMETER;
141 if (ntlmssp_command != NTLMSSP_NEGOTIATE) {
142 DEBUG(1, ("%s: no NTLMSSP Negotiate message (length %u)\n",
143 __func__, (unsigned int)in.length));
144 dump_data(2, in.data, in.length);
145 return NT_STATUS_INVALID_PARAMETER;
148 ntlmssp_state->neg_flags = neg_flags;
149 DEBUG(3, ("Imported Negotiate flags:\n"));
150 debug_ntlmssp_flags(neg_flags);
152 if (ntlmssp_state->neg_flags & NTLMSSP_NEGOTIATE_UNICODE) {
153 ntlmssp_state->unicode = true;
155 ntlmssp_state->unicode = false;
158 if (ntlmssp_state->neg_flags & NTLMSSP_NEGOTIATE_SIGN) {
159 gensec_security->want_features |= GENSEC_FEATURE_SIGN;
161 ntlmssp_state->neg_flags |= NTLMSSP_NEGOTIATE_SIGN;
164 if (ntlmssp_state->neg_flags & NTLMSSP_NEGOTIATE_SEAL) {
165 gensec_security->want_features |= GENSEC_FEATURE_SEAL;
167 ntlmssp_state->neg_flags |= NTLMSSP_NEGOTIATE_SIGN;
168 ntlmssp_state->neg_flags |= NTLMSSP_NEGOTIATE_SEAL;
171 if (DEBUGLEVEL >= 10) {
172 struct NEGOTIATE_MESSAGE *negotiate = talloc(
173 ntlmssp_state, struct NEGOTIATE_MESSAGE);
174 if (negotiate != NULL) {
175 status = ntlmssp_pull_NEGOTIATE_MESSAGE(
176 &in, negotiate, negotiate);
177 if (NT_STATUS_IS_OK(status)) {
178 NDR_PRINT_DEBUG(NEGOTIATE_MESSAGE,
181 TALLOC_FREE(negotiate);
185 ntlmssp_state->expected_state = NTLMSSP_CHALLENGE;
187 return NT_STATUS_MORE_PROCESSING_REQUIRED;
191 * Next state function for the Challenge Packet. Generate an auth packet.
193 * @param gensec_security GENSEC state
194 * @param out_mem_ctx Memory context for *out
195 * @param in The server challnege, as a DATA_BLOB. reply.data must be NULL
196 * @param out The next request (auth packet) to the server, as an allocated DATA_BLOB, on the out_mem_ctx context
197 * @return Errors or NT_STATUS_OK.
200 NTSTATUS ntlmssp_client_challenge(struct gensec_security *gensec_security,
201 TALLOC_CTX *out_mem_ctx,
202 const DATA_BLOB in, DATA_BLOB *out)
204 struct gensec_ntlmssp_context *gensec_ntlmssp =
205 talloc_get_type_abort(gensec_security->private_data,
206 struct gensec_ntlmssp_context);
207 struct ntlmssp_state *ntlmssp_state = gensec_ntlmssp->ntlmssp_state;
208 uint32_t chal_flags, ntlmssp_command, unkn1 = 0, unkn2 = 0;
209 DATA_BLOB server_domain_blob;
210 DATA_BLOB challenge_blob;
211 DATA_BLOB target_info = data_blob(NULL, 0);
213 const char *chal_parse_string;
214 const char *chal_parse_string_short = NULL;
215 const char *auth_gen_string;
216 DATA_BLOB lm_response = data_blob(NULL, 0);
217 DATA_BLOB nt_response = data_blob(NULL, 0);
218 DATA_BLOB session_key = data_blob(NULL, 0);
219 DATA_BLOB lm_session_key = data_blob(NULL, 0);
220 DATA_BLOB encrypted_session_key = data_blob(NULL, 0);
223 const char *user = NULL, *domain = NULL, *workstation = NULL;
224 bool is_anonymous = false;
225 const DATA_BLOB version_blob = ntlmssp_version_blob();
227 TALLOC_CTX *mem_ctx = talloc_new(out_mem_ctx);
229 return NT_STATUS_NO_MEMORY;
232 if (!msrpc_parse(mem_ctx,
238 DEBUG(1, ("Failed to parse the NTLMSSP Challenge: (#1)\n"));
239 dump_data(2, in.data, in.length);
240 talloc_free(mem_ctx);
242 return NT_STATUS_INVALID_PARAMETER;
245 data_blob_free(&server_domain_blob);
247 DEBUG(3, ("Got challenge flags:\n"));
248 debug_ntlmssp_flags(chal_flags);
250 nt_status = ntlmssp_handle_neg_flags(ntlmssp_state,
251 chal_flags, "challenge");
252 if (!NT_STATUS_IS_OK(nt_status)) {
256 if (ntlmssp_state->unicode) {
257 if (chal_flags & NTLMSSP_NEGOTIATE_TARGET_INFO) {
258 chal_parse_string = "CdUdbddB";
260 chal_parse_string = "CdUdbdd";
261 chal_parse_string_short = "CdUdb";
263 auth_gen_string = "CdBBUUUBdb";
265 if (chal_flags & NTLMSSP_NEGOTIATE_TARGET_INFO) {
266 chal_parse_string = "CdAdbddB";
268 chal_parse_string = "CdAdbdd";
269 chal_parse_string_short = "CdAdb";
272 auth_gen_string = "CdBBAAABdb";
275 if (!msrpc_parse(mem_ctx,
276 &in, chal_parse_string,
287 DEBUG(1, ("Failed to parse the NTLMSSP Challenge: (#2)\n"));
289 if (chal_parse_string_short != NULL) {
291 * In the case where NTLMSSP_NEGOTIATE_TARGET_INFO
292 * is not used, some NTLMSSP servers don't return
293 * the unused unkn1 and unkn2 fields.
295 * https://bugzilla.samba.org/show_bug.cgi?id=10016
297 * Try and parse again without them.
299 ok = msrpc_parse(mem_ctx,
300 &in, chal_parse_string_short,
307 DEBUG(1, ("Failed to short parse "
308 "the NTLMSSP Challenge: (#2)\n"));
313 dump_data(2, in.data, in.length);
314 talloc_free(mem_ctx);
315 return NT_STATUS_INVALID_PARAMETER;
319 if (chal_flags & NTLMSSP_TARGET_TYPE_SERVER) {
320 ntlmssp_state->server.is_standalone = true;
322 ntlmssp_state->server.is_standalone = false;
324 /* TODO: parse struct_blob and fill in the rest */
325 ntlmssp_state->server.netbios_name = "";
326 ntlmssp_state->server.netbios_domain = talloc_move(ntlmssp_state, &server_domain);
327 ntlmssp_state->server.dns_name = "";
328 ntlmssp_state->server.dns_domain = "";
330 if (challenge_blob.length != 8) {
331 talloc_free(mem_ctx);
332 return NT_STATUS_INVALID_PARAMETER;
335 is_anonymous = cli_credentials_is_anonymous(gensec_security->credentials);
336 cli_credentials_get_ntlm_username_domain(gensec_security->credentials, mem_ctx,
339 workstation = cli_credentials_get_workstation(gensec_security->credentials);
342 DEBUG(10, ("User is NULL, returning INVALID_PARAMETER\n"));
343 return NT_STATUS_INVALID_PARAMETER;
346 if (domain == NULL) {
347 DEBUG(10, ("Domain is NULL, returning INVALID_PARAMETER\n"));
348 return NT_STATUS_INVALID_PARAMETER;
351 if (workstation == NULL) {
352 DEBUG(10, ("Workstation is NULL, returning INVALID_PARAMETER\n"));
353 return NT_STATUS_INVALID_PARAMETER;
357 ntlmssp_state->neg_flags |= NTLMSSP_ANONYMOUS;
359 * don't use the ccache for anonymous auth
361 ntlmssp_state->use_ccache = false;
363 if (ntlmssp_state->use_ccache) {
364 struct samr_Password *nt_hash = NULL;
367 * If we have a password given we don't
370 nt_hash = cli_credentials_get_nt_hash(gensec_security->credentials,
372 if (nt_hash != NULL) {
373 ZERO_STRUCTP(nt_hash);
374 TALLOC_FREE(nt_hash);
375 ntlmssp_state->use_ccache = false;
379 if (ntlmssp_state->use_ccache) {
380 struct wbcCredentialCacheParams params;
381 struct wbcCredentialCacheInfo *info = NULL;
382 struct wbcAuthErrorInfo *error = NULL;
383 struct wbcNamedBlob auth_blobs[1];
384 const struct wbcBlob *wbc_auth_blob = NULL;
385 const struct wbcBlob *wbc_session_key = NULL;
389 params.account_name = user;
390 params.domain_name = domain;
391 params.level = WBC_CREDENTIAL_CACHE_LEVEL_NTLMSSP;
393 auth_blobs[0].name = "challenge_blob";
394 auth_blobs[0].flags = 0;
395 auth_blobs[0].blob.data = in.data;
396 auth_blobs[0].blob.length = in.length;
397 params.num_blobs = ARRAY_SIZE(auth_blobs);
398 params.blobs = auth_blobs;
400 wbc_status = wbcCredentialCache(¶ms, &info, &error);
401 wbcFreeMemory(error);
402 if (!WBC_ERROR_IS_OK(wbc_status)) {
403 return NT_STATUS_WRONG_CREDENTIAL_HANDLE;
406 for (i=0; i<info->num_blobs; i++) {
407 if (strequal(info->blobs[i].name, "auth_blob")) {
408 wbc_auth_blob = &info->blobs[i].blob;
410 if (strequal(info->blobs[i].name, "session_key")) {
411 wbc_session_key = &info->blobs[i].blob;
414 if ((wbc_auth_blob == NULL) || (wbc_session_key == NULL)) {
416 return NT_STATUS_WRONG_CREDENTIAL_HANDLE;
419 session_key = data_blob_talloc(mem_ctx,
420 wbc_session_key->data,
421 wbc_session_key->length);
422 if (session_key.length != wbc_session_key->length) {
424 return NT_STATUS_NO_MEMORY;
426 *out = data_blob_talloc(mem_ctx,
428 wbc_auth_blob->length);
429 if (out->length != wbc_auth_blob->length) {
431 return NT_STATUS_NO_MEMORY;
438 if (ntlmssp_state->neg_flags & NTLMSSP_NEGOTIATE_NTLM2) {
439 flags |= CLI_CRED_NTLM2;
441 if (ntlmssp_state->use_ntlmv2) {
442 flags |= CLI_CRED_NTLMv2_AUTH;
444 if (ntlmssp_state->use_nt_response) {
445 flags |= CLI_CRED_NTLM_AUTH;
447 if (lpcfg_client_lanman_auth(gensec_security->settings->lp_ctx)) {
448 flags |= CLI_CRED_LANMAN_AUTH;
451 nt_status = cli_credentials_get_ntlm_response(gensec_security->credentials, mem_ctx,
452 &flags, challenge_blob, target_info,
453 &lm_response, &nt_response,
454 &lm_session_key, &session_key);
456 if (!NT_STATUS_IS_OK(nt_status)) {
460 if (!(flags & CLI_CRED_LANMAN_AUTH)) {
461 /* LM Key is still possible, just silly, so we do not
462 * allow it. Fortunetly all LM crypto is off by
463 * default and we require command line options to end
465 ntlmssp_state->neg_flags &= ~NTLMSSP_NEGOTIATE_LM_KEY;
468 if (!(flags & CLI_CRED_NTLM2)) {
469 /* NTLM2 is incompatible... */
470 ntlmssp_state->neg_flags &= ~NTLMSSP_NEGOTIATE_NTLM2;
473 if ((ntlmssp_state->neg_flags & NTLMSSP_NEGOTIATE_LM_KEY)
474 && lpcfg_client_lanman_auth(gensec_security->settings->lp_ctx) && lm_session_key.length == 16) {
475 DATA_BLOB new_session_key = data_blob_talloc(mem_ctx, NULL, 16);
476 if (lm_response.length == 24) {
477 SMBsesskeygen_lm_sess_key(lm_session_key.data, lm_response.data,
478 new_session_key.data);
480 static const uint8_t zeros[24];
481 SMBsesskeygen_lm_sess_key(lm_session_key.data, zeros,
482 new_session_key.data);
484 session_key = new_session_key;
485 dump_data_pw("LM session key\n", session_key.data, session_key.length);
489 /* Key exchange encryptes a new client-generated session key with
490 the password-derived key */
491 if (ntlmssp_state->neg_flags & NTLMSSP_NEGOTIATE_KEY_EXCH) {
492 /* Make up a new session key */
493 uint8_t client_session_key[16];
494 generate_secret_buffer(client_session_key, sizeof(client_session_key));
496 /* Encrypt the new session key with the old one */
497 encrypted_session_key = data_blob_talloc(ntlmssp_state,
498 client_session_key, sizeof(client_session_key));
499 dump_data_pw("KEY_EXCH session key:\n", encrypted_session_key.data, encrypted_session_key.length);
500 arcfour_crypt(encrypted_session_key.data, session_key.data, encrypted_session_key.length);
501 dump_data_pw("KEY_EXCH session key (enc):\n", encrypted_session_key.data, encrypted_session_key.length);
503 /* Mark the new session key as the 'real' session key */
504 session_key = data_blob_talloc(mem_ctx, client_session_key, sizeof(client_session_key));
507 /* this generates the actual auth packet */
508 nt_status = msrpc_gen(mem_ctx,
509 out, auth_gen_string,
512 lm_response.data, lm_response.length,
513 nt_response.data, nt_response.length,
517 encrypted_session_key.data, encrypted_session_key.length,
518 ntlmssp_state->neg_flags,
519 version_blob.data, version_blob.length);
520 if (!NT_STATUS_IS_OK(nt_status)) {
521 talloc_free(mem_ctx);
526 ntlmssp_state->session_key = session_key;
527 talloc_steal(ntlmssp_state, session_key.data);
529 DEBUG(3, ("NTLMSSP: Set final flags:\n"));
530 debug_ntlmssp_flags(ntlmssp_state->neg_flags);
532 talloc_steal(out_mem_ctx, out->data);
534 ntlmssp_state->expected_state = NTLMSSP_DONE;
536 if (gensec_security->want_features & (GENSEC_FEATURE_SIGN|GENSEC_FEATURE_SEAL)) {
537 nt_status = ntlmssp_sign_init(ntlmssp_state);
538 if (!NT_STATUS_IS_OK(nt_status)) {
539 DEBUG(1, ("Could not setup NTLMSSP signing/sealing system (error was: %s)\n",
540 nt_errstr(nt_status)));
541 talloc_free(mem_ctx);
546 talloc_free(mem_ctx);
550 NTSTATUS gensec_ntlmssp_client_start(struct gensec_security *gensec_security)
552 struct gensec_ntlmssp_context *gensec_ntlmssp;
553 struct ntlmssp_state *ntlmssp_state;
556 nt_status = gensec_ntlmssp_start(gensec_security);
557 NT_STATUS_NOT_OK_RETURN(nt_status);
560 talloc_get_type_abort(gensec_security->private_data,
561 struct gensec_ntlmssp_context);
563 ntlmssp_state = talloc_zero(gensec_ntlmssp,
564 struct ntlmssp_state);
565 if (!ntlmssp_state) {
566 return NT_STATUS_NO_MEMORY;
569 gensec_ntlmssp->ntlmssp_state = ntlmssp_state;
571 ntlmssp_state = gensec_ntlmssp->ntlmssp_state;
573 ntlmssp_state->role = NTLMSSP_CLIENT;
575 ntlmssp_state->client.netbios_domain = lpcfg_workgroup(gensec_security->settings->lp_ctx);
576 ntlmssp_state->client.netbios_name = cli_credentials_get_workstation(gensec_security->credentials);
578 ntlmssp_state->unicode = gensec_setting_bool(gensec_security->settings, "ntlmssp_client", "unicode", true);
580 ntlmssp_state->use_nt_response = gensec_setting_bool(gensec_security->settings, "ntlmssp_client", "send_nt_reponse", true);
582 ntlmssp_state->allow_lm_key = (lpcfg_client_lanman_auth(gensec_security->settings->lp_ctx)
583 && (gensec_setting_bool(gensec_security->settings, "ntlmssp_client", "allow_lm_key", false)
584 || gensec_setting_bool(gensec_security->settings, "ntlmssp_client", "lm_key", false)));
586 ntlmssp_state->use_ntlmv2 = lpcfg_client_ntlmv2_auth(gensec_security->settings->lp_ctx);
588 ntlmssp_state->expected_state = NTLMSSP_INITIAL;
590 ntlmssp_state->neg_flags =
591 NTLMSSP_NEGOTIATE_NTLM |
592 NTLMSSP_NEGOTIATE_VERSION |
593 NTLMSSP_REQUEST_TARGET;
595 if (ntlmssp_state->unicode) {
596 ntlmssp_state->neg_flags |= NTLMSSP_NEGOTIATE_UNICODE;
598 ntlmssp_state->neg_flags |= NTLMSSP_NEGOTIATE_OEM;
601 if (gensec_setting_bool(gensec_security->settings, "ntlmssp_client", "128bit", true)) {
602 ntlmssp_state->neg_flags |= NTLMSSP_NEGOTIATE_128;
605 if (gensec_setting_bool(gensec_security->settings, "ntlmssp_client", "56bit", false)) {
606 ntlmssp_state->neg_flags |= NTLMSSP_NEGOTIATE_56;
609 if (gensec_setting_bool(gensec_security->settings, "ntlmssp_client", "lm_key", false)) {
610 ntlmssp_state->neg_flags |= NTLMSSP_NEGOTIATE_LM_KEY;
613 if (gensec_setting_bool(gensec_security->settings, "ntlmssp_client", "keyexchange", true)) {
614 ntlmssp_state->neg_flags |= NTLMSSP_NEGOTIATE_KEY_EXCH;
617 if (gensec_setting_bool(gensec_security->settings, "ntlmssp_client", "alwayssign", true)) {
618 ntlmssp_state->neg_flags |= NTLMSSP_NEGOTIATE_ALWAYS_SIGN;
621 if (gensec_setting_bool(gensec_security->settings, "ntlmssp_client", "ntlm2", true)) {
622 ntlmssp_state->neg_flags |= NTLMSSP_NEGOTIATE_NTLM2;
624 /* apparently we can't do ntlmv2 if we don't do ntlm2 */
625 ntlmssp_state->use_ntlmv2 = false;
628 if (ntlmssp_state->use_ntlmv2) {
629 ntlmssp_state->neg_flags |= NTLMSSP_NEGOTIATE_NTLM2;
632 if (gensec_security->want_features & GENSEC_FEATURE_SESSION_KEY) {
634 * We need to set this to allow a later SetPassword
635 * via the SAMR pipe to succeed. Strange.... We could
636 * also add NTLMSSP_NEGOTIATE_SEAL here. JRA.
638 * Without this, Windows will not create the master key
639 * that it thinks is only used for NTLMSSP signing and
640 * sealing. (It is actually pulled out and used directly)
642 ntlmssp_state->neg_flags |= NTLMSSP_NEGOTIATE_SIGN;
644 if (gensec_security->want_features & GENSEC_FEATURE_SIGN) {
645 ntlmssp_state->neg_flags |= NTLMSSP_NEGOTIATE_SIGN;
647 if (gensec_security->want_features & GENSEC_FEATURE_LDAP_STYLE) {
649 * We need to handle NTLMSSP_NEGOTIATE_SIGN as
650 * NTLMSSP_NEGOTIATE_SEAL if GENSEC_FEATURE_LDAP_STYLE
653 ntlmssp_state->force_wrap_seal = true;
655 * We want also work against old Samba servers
656 * which didn't had GENSEC_FEATURE_LDAP_STYLE
657 * we negotiate SEAL too. We may remove this
658 * in a few years. As all servers should have
659 * GENSEC_FEATURE_LDAP_STYLE by then.
661 ntlmssp_state->neg_flags |= NTLMSSP_NEGOTIATE_SEAL;
664 if (gensec_security->want_features & GENSEC_FEATURE_SEAL) {
665 ntlmssp_state->neg_flags |= NTLMSSP_NEGOTIATE_SIGN;
666 ntlmssp_state->neg_flags |= NTLMSSP_NEGOTIATE_SEAL;
668 if (gensec_security->want_features & GENSEC_FEATURE_NTLM_CCACHE) {
669 ntlmssp_state->use_ccache = true;
675 NTSTATUS gensec_ntlmssp_resume_ccache_start(struct gensec_security *gensec_security)
677 struct gensec_ntlmssp_context *gensec_ntlmssp = NULL;
680 status = gensec_ntlmssp_client_start(gensec_security);
681 if (!NT_STATUS_IS_OK(status)) {
685 gensec_ntlmssp = talloc_get_type_abort(gensec_security->private_data,
686 struct gensec_ntlmssp_context);
687 gensec_ntlmssp->ntlmssp_state->use_ccache = false;
688 gensec_ntlmssp->ntlmssp_state->resume_ccache = true;
689 gensec_ntlmssp->ntlmssp_state->expected_state = NTLMSSP_NEGOTIATE;