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 ntlmssp_handle_neg_flags(ntlmssp_state, chal_flags, ntlmssp_state->allow_lm_key);
252 if (ntlmssp_state->unicode) {
253 if (chal_flags & NTLMSSP_NEGOTIATE_TARGET_INFO) {
254 chal_parse_string = "CdUdbddB";
256 chal_parse_string = "CdUdbdd";
257 chal_parse_string_short = "CdUdb";
259 auth_gen_string = "CdBBUUUBdb";
261 if (chal_flags & NTLMSSP_NEGOTIATE_TARGET_INFO) {
262 chal_parse_string = "CdAdbddB";
264 chal_parse_string = "CdAdbdd";
265 chal_parse_string_short = "CdAdb";
268 auth_gen_string = "CdBBAAABdb";
271 if (!msrpc_parse(mem_ctx,
272 &in, chal_parse_string,
283 DEBUG(1, ("Failed to parse the NTLMSSP Challenge: (#2)\n"));
285 if (chal_parse_string_short != NULL) {
287 * In the case where NTLMSSP_NEGOTIATE_TARGET_INFO
288 * is not used, some NTLMSSP servers don't return
289 * the unused unkn1 and unkn2 fields.
291 * https://bugzilla.samba.org/show_bug.cgi?id=10016
293 * Try and parse again without them.
295 ok = msrpc_parse(mem_ctx,
296 &in, chal_parse_string_short,
303 DEBUG(1, ("Failed to short parse "
304 "the NTLMSSP Challenge: (#2)\n"));
309 dump_data(2, in.data, in.length);
310 talloc_free(mem_ctx);
311 return NT_STATUS_INVALID_PARAMETER;
315 if (chal_flags & NTLMSSP_TARGET_TYPE_SERVER) {
316 ntlmssp_state->server.is_standalone = true;
318 ntlmssp_state->server.is_standalone = false;
320 /* TODO: parse struct_blob and fill in the rest */
321 ntlmssp_state->server.netbios_name = "";
322 ntlmssp_state->server.netbios_domain = talloc_move(ntlmssp_state, &server_domain);
323 ntlmssp_state->server.dns_name = "";
324 ntlmssp_state->server.dns_domain = "";
326 if (challenge_blob.length != 8) {
327 talloc_free(mem_ctx);
328 return NT_STATUS_INVALID_PARAMETER;
331 is_anonymous = cli_credentials_is_anonymous(gensec_security->credentials);
332 cli_credentials_get_ntlm_username_domain(gensec_security->credentials, mem_ctx,
335 workstation = cli_credentials_get_workstation(gensec_security->credentials);
338 DEBUG(10, ("User is NULL, returning INVALID_PARAMETER\n"));
339 return NT_STATUS_INVALID_PARAMETER;
342 if (domain == NULL) {
343 DEBUG(10, ("Domain is NULL, returning INVALID_PARAMETER\n"));
344 return NT_STATUS_INVALID_PARAMETER;
347 if (workstation == NULL) {
348 DEBUG(10, ("Workstation is NULL, returning INVALID_PARAMETER\n"));
349 return NT_STATUS_INVALID_PARAMETER;
353 ntlmssp_state->neg_flags |= NTLMSSP_ANONYMOUS;
355 * don't use the ccache for anonymous auth
357 ntlmssp_state->use_ccache = false;
359 if (ntlmssp_state->use_ccache) {
360 struct samr_Password *nt_hash = NULL;
363 * If we have a password given we don't
366 nt_hash = cli_credentials_get_nt_hash(gensec_security->credentials,
368 if (nt_hash != NULL) {
369 ZERO_STRUCTP(nt_hash);
370 TALLOC_FREE(nt_hash);
371 ntlmssp_state->use_ccache = false;
375 if (ntlmssp_state->use_ccache) {
376 struct wbcCredentialCacheParams params;
377 struct wbcCredentialCacheInfo *info = NULL;
378 struct wbcAuthErrorInfo *error = NULL;
379 struct wbcNamedBlob auth_blobs[1];
380 const struct wbcBlob *wbc_auth_blob = NULL;
381 const struct wbcBlob *wbc_session_key = NULL;
385 params.account_name = user;
386 params.domain_name = domain;
387 params.level = WBC_CREDENTIAL_CACHE_LEVEL_NTLMSSP;
389 auth_blobs[0].name = "challenge_blob";
390 auth_blobs[0].flags = 0;
391 auth_blobs[0].blob.data = in.data;
392 auth_blobs[0].blob.length = in.length;
393 params.num_blobs = ARRAY_SIZE(auth_blobs);
394 params.blobs = auth_blobs;
396 wbc_status = wbcCredentialCache(¶ms, &info, &error);
397 wbcFreeMemory(error);
398 if (!WBC_ERROR_IS_OK(wbc_status)) {
399 return NT_STATUS_WRONG_CREDENTIAL_HANDLE;
402 for (i=0; i<info->num_blobs; i++) {
403 if (strequal(info->blobs[i].name, "auth_blob")) {
404 wbc_auth_blob = &info->blobs[i].blob;
406 if (strequal(info->blobs[i].name, "session_key")) {
407 wbc_session_key = &info->blobs[i].blob;
410 if ((wbc_auth_blob == NULL) || (wbc_session_key == NULL)) {
412 return NT_STATUS_WRONG_CREDENTIAL_HANDLE;
415 session_key = data_blob_talloc(mem_ctx,
416 wbc_session_key->data,
417 wbc_session_key->length);
418 if (session_key.length != wbc_session_key->length) {
420 return NT_STATUS_NO_MEMORY;
422 *out = data_blob_talloc(mem_ctx,
424 wbc_auth_blob->length);
425 if (out->length != wbc_auth_blob->length) {
427 return NT_STATUS_NO_MEMORY;
434 if (ntlmssp_state->neg_flags & NTLMSSP_NEGOTIATE_NTLM2) {
435 flags |= CLI_CRED_NTLM2;
437 if (ntlmssp_state->use_ntlmv2) {
438 flags |= CLI_CRED_NTLMv2_AUTH;
440 if (ntlmssp_state->use_nt_response) {
441 flags |= CLI_CRED_NTLM_AUTH;
443 if (lpcfg_client_lanman_auth(gensec_security->settings->lp_ctx)) {
444 flags |= CLI_CRED_LANMAN_AUTH;
447 nt_status = cli_credentials_get_ntlm_response(gensec_security->credentials, mem_ctx,
448 &flags, challenge_blob, target_info,
449 &lm_response, &nt_response,
450 &lm_session_key, &session_key);
452 if (!NT_STATUS_IS_OK(nt_status)) {
456 if (!(flags & CLI_CRED_LANMAN_AUTH)) {
457 /* LM Key is still possible, just silly, so we do not
458 * allow it. Fortunetly all LM crypto is off by
459 * default and we require command line options to end
461 ntlmssp_state->neg_flags &= ~NTLMSSP_NEGOTIATE_LM_KEY;
464 if (!(flags & CLI_CRED_NTLM2)) {
465 /* NTLM2 is incompatible... */
466 ntlmssp_state->neg_flags &= ~NTLMSSP_NEGOTIATE_NTLM2;
469 if ((ntlmssp_state->neg_flags & NTLMSSP_NEGOTIATE_LM_KEY)
470 && lpcfg_client_lanman_auth(gensec_security->settings->lp_ctx) && lm_session_key.length == 16) {
471 DATA_BLOB new_session_key = data_blob_talloc(mem_ctx, NULL, 16);
472 if (lm_response.length == 24) {
473 SMBsesskeygen_lm_sess_key(lm_session_key.data, lm_response.data,
474 new_session_key.data);
476 static const uint8_t zeros[24];
477 SMBsesskeygen_lm_sess_key(lm_session_key.data, zeros,
478 new_session_key.data);
480 session_key = new_session_key;
481 dump_data_pw("LM session key\n", session_key.data, session_key.length);
485 /* Key exchange encryptes a new client-generated session key with
486 the password-derived key */
487 if (ntlmssp_state->neg_flags & NTLMSSP_NEGOTIATE_KEY_EXCH) {
488 /* Make up a new session key */
489 uint8_t client_session_key[16];
490 generate_secret_buffer(client_session_key, sizeof(client_session_key));
492 /* Encrypt the new session key with the old one */
493 encrypted_session_key = data_blob_talloc(ntlmssp_state,
494 client_session_key, sizeof(client_session_key));
495 dump_data_pw("KEY_EXCH session key:\n", encrypted_session_key.data, encrypted_session_key.length);
496 arcfour_crypt(encrypted_session_key.data, session_key.data, encrypted_session_key.length);
497 dump_data_pw("KEY_EXCH session key (enc):\n", encrypted_session_key.data, encrypted_session_key.length);
499 /* Mark the new session key as the 'real' session key */
500 session_key = data_blob_talloc(mem_ctx, client_session_key, sizeof(client_session_key));
503 /* this generates the actual auth packet */
504 nt_status = msrpc_gen(mem_ctx,
505 out, auth_gen_string,
508 lm_response.data, lm_response.length,
509 nt_response.data, nt_response.length,
513 encrypted_session_key.data, encrypted_session_key.length,
514 ntlmssp_state->neg_flags,
515 version_blob.data, version_blob.length);
516 if (!NT_STATUS_IS_OK(nt_status)) {
517 talloc_free(mem_ctx);
522 ntlmssp_state->session_key = session_key;
523 talloc_steal(ntlmssp_state, session_key.data);
525 DEBUG(3, ("NTLMSSP: Set final flags:\n"));
526 debug_ntlmssp_flags(ntlmssp_state->neg_flags);
528 talloc_steal(out_mem_ctx, out->data);
530 ntlmssp_state->expected_state = NTLMSSP_DONE;
532 if (gensec_security->want_features & (GENSEC_FEATURE_SIGN|GENSEC_FEATURE_SEAL)) {
533 nt_status = ntlmssp_sign_init(ntlmssp_state);
534 if (!NT_STATUS_IS_OK(nt_status)) {
535 DEBUG(1, ("Could not setup NTLMSSP signing/sealing system (error was: %s)\n",
536 nt_errstr(nt_status)));
537 talloc_free(mem_ctx);
542 talloc_free(mem_ctx);
546 NTSTATUS gensec_ntlmssp_client_start(struct gensec_security *gensec_security)
548 struct gensec_ntlmssp_context *gensec_ntlmssp;
549 struct ntlmssp_state *ntlmssp_state;
552 nt_status = gensec_ntlmssp_start(gensec_security);
553 NT_STATUS_NOT_OK_RETURN(nt_status);
556 talloc_get_type_abort(gensec_security->private_data,
557 struct gensec_ntlmssp_context);
559 ntlmssp_state = talloc_zero(gensec_ntlmssp,
560 struct ntlmssp_state);
561 if (!ntlmssp_state) {
562 return NT_STATUS_NO_MEMORY;
565 gensec_ntlmssp->ntlmssp_state = ntlmssp_state;
567 ntlmssp_state = gensec_ntlmssp->ntlmssp_state;
569 ntlmssp_state->role = NTLMSSP_CLIENT;
571 ntlmssp_state->client.netbios_domain = lpcfg_workgroup(gensec_security->settings->lp_ctx);
572 ntlmssp_state->client.netbios_name = cli_credentials_get_workstation(gensec_security->credentials);
574 ntlmssp_state->unicode = gensec_setting_bool(gensec_security->settings, "ntlmssp_client", "unicode", true);
576 ntlmssp_state->use_nt_response = gensec_setting_bool(gensec_security->settings, "ntlmssp_client", "send_nt_reponse", true);
578 ntlmssp_state->allow_lm_key = (lpcfg_client_lanman_auth(gensec_security->settings->lp_ctx)
579 && (gensec_setting_bool(gensec_security->settings, "ntlmssp_client", "allow_lm_key", false)
580 || gensec_setting_bool(gensec_security->settings, "ntlmssp_client", "lm_key", false)));
582 ntlmssp_state->use_ntlmv2 = lpcfg_client_ntlmv2_auth(gensec_security->settings->lp_ctx);
584 ntlmssp_state->expected_state = NTLMSSP_INITIAL;
586 ntlmssp_state->neg_flags =
587 NTLMSSP_NEGOTIATE_NTLM |
588 NTLMSSP_NEGOTIATE_VERSION |
589 NTLMSSP_REQUEST_TARGET;
591 if (ntlmssp_state->unicode) {
592 ntlmssp_state->neg_flags |= NTLMSSP_NEGOTIATE_UNICODE;
594 ntlmssp_state->neg_flags |= NTLMSSP_NEGOTIATE_OEM;
597 if (gensec_setting_bool(gensec_security->settings, "ntlmssp_client", "128bit", true)) {
598 ntlmssp_state->neg_flags |= NTLMSSP_NEGOTIATE_128;
601 if (gensec_setting_bool(gensec_security->settings, "ntlmssp_client", "56bit", false)) {
602 ntlmssp_state->neg_flags |= NTLMSSP_NEGOTIATE_56;
605 if (gensec_setting_bool(gensec_security->settings, "ntlmssp_client", "lm_key", false)) {
606 ntlmssp_state->neg_flags |= NTLMSSP_NEGOTIATE_LM_KEY;
609 if (gensec_setting_bool(gensec_security->settings, "ntlmssp_client", "keyexchange", true)) {
610 ntlmssp_state->neg_flags |= NTLMSSP_NEGOTIATE_KEY_EXCH;
613 if (gensec_setting_bool(gensec_security->settings, "ntlmssp_client", "alwayssign", true)) {
614 ntlmssp_state->neg_flags |= NTLMSSP_NEGOTIATE_ALWAYS_SIGN;
617 if (gensec_setting_bool(gensec_security->settings, "ntlmssp_client", "ntlm2", true)) {
618 ntlmssp_state->neg_flags |= NTLMSSP_NEGOTIATE_NTLM2;
620 /* apparently we can't do ntlmv2 if we don't do ntlm2 */
621 ntlmssp_state->use_ntlmv2 = false;
624 if (ntlmssp_state->use_ntlmv2) {
625 ntlmssp_state->neg_flags |= NTLMSSP_NEGOTIATE_NTLM2;
628 if (gensec_security->want_features & GENSEC_FEATURE_SESSION_KEY) {
630 * We need to set this to allow a later SetPassword
631 * via the SAMR pipe to succeed. Strange.... We could
632 * also add NTLMSSP_NEGOTIATE_SEAL here. JRA.
634 * Without this, Windows will not create the master key
635 * that it thinks is only used for NTLMSSP signing and
636 * sealing. (It is actually pulled out and used directly)
638 ntlmssp_state->neg_flags |= NTLMSSP_NEGOTIATE_SIGN;
640 if (gensec_security->want_features & GENSEC_FEATURE_SIGN) {
641 ntlmssp_state->neg_flags |= NTLMSSP_NEGOTIATE_SIGN;
643 if (gensec_security->want_features & GENSEC_FEATURE_LDAP_STYLE) {
645 * We need to handle NTLMSSP_NEGOTIATE_SIGN as
646 * NTLMSSP_NEGOTIATE_SEAL if GENSEC_FEATURE_LDAP_STYLE
649 ntlmssp_state->force_wrap_seal = true;
651 * We want also work against old Samba servers
652 * which didn't had GENSEC_FEATURE_LDAP_STYLE
653 * we negotiate SEAL too. We may remove this
654 * in a few years. As all servers should have
655 * GENSEC_FEATURE_LDAP_STYLE by then.
657 ntlmssp_state->neg_flags |= NTLMSSP_NEGOTIATE_SEAL;
660 if (gensec_security->want_features & GENSEC_FEATURE_SEAL) {
661 ntlmssp_state->neg_flags |= NTLMSSP_NEGOTIATE_SIGN;
662 ntlmssp_state->neg_flags |= NTLMSSP_NEGOTIATE_SEAL;
664 if (gensec_security->want_features & GENSEC_FEATURE_NTLM_CCACHE) {
665 ntlmssp_state->use_ccache = true;
671 NTSTATUS gensec_ntlmssp_resume_ccache_start(struct gensec_security *gensec_security)
673 struct gensec_ntlmssp_context *gensec_ntlmssp = NULL;
676 status = gensec_ntlmssp_client_start(gensec_security);
677 if (!NT_STATUS_IS_OK(status)) {
681 gensec_ntlmssp = talloc_get_type_abort(gensec_security->private_data,
682 struct gensec_ntlmssp_context);
683 gensec_ntlmssp->ntlmssp_state->use_ccache = false;
684 gensec_ntlmssp->ntlmssp_state->resume_ccache = true;
685 gensec_ntlmssp->ntlmssp_state->expected_state = NTLMSSP_NEGOTIATE;