#include "smbd/smbd.h"
#include "smbd/globals.h"
#include "../libcli/auth/spnego.h"
-#include "../libcli/auth/ntlmssp.h"
+#include "../auth/ntlmssp/ntlmssp.h"
#include "ntlmssp_wrap.h"
#include "../librpc/gen_ndr/krb5pac.h"
#include "libads/kerberos_proto.h"
struct smbd_server_connection *sconn = req->sconn;
if (NT_STATUS_IS_OK(nt_status)) {
- nt_status = auth_ntlmssp_session_info(talloc_tos(),
- (*auth_ntlmssp_state), &session_info);
+ nt_status = gensec_session_info((*auth_ntlmssp_state)->gensec_security,
+ talloc_tos(),
+ &session_info);
}
reply_outbuf(req, 4, 0);
return;
}
- status = auth_ntlmssp_update(*auth_ntlmssp_state, talloc_tos(),
- secblob, &chal);
+ status = gensec_update((*auth_ntlmssp_state)->gensec_security, talloc_tos(),
+ NULL, secblob, &chal);
data_blob_free(&secblob);
}
}
- status = auth_ntlmssp_update(*auth_ntlmssp_state, talloc_tos(),
- auth, &auth_reply);
+ status = gensec_update((*auth_ntlmssp_state)->gensec_security, talloc_tos(),
+ NULL, auth, &auth_reply);
data_blob_free(&auth);
* identical regardless. In particular, both rely only on the
* status code (not the contents of the packet) and do not
* wrap the result */
- if (sconn->use_gensec_hook || (blob1.length > 7 && strncmp((char *)(blob1.data), "NTLMSSP", 7) == 0)) {
+ if (sconn->use_gensec_hook || ntlmssp_blob_matches_magic(&blob1)) {
DATA_BLOB chal;
if (!vuser->auth_ntlmssp_state) {
}
}
- status = auth_ntlmssp_update(vuser->auth_ntlmssp_state,
- talloc_tos(),
- blob1, &chal);
+ status = gensec_update(vuser->auth_ntlmssp_state->gensec_security,
+ talloc_tos(), NULL,
+ blob1, &chal);
data_blob_free(&blob1);
struct smbd_server_connection *sconn = req->sconn;
bool doencrypt = sconn->smb1.negprot.encrypted_passwords;
+ bool signing_allowed = false;
+ bool signing_mandatory = false;
START_PROFILE(SMBsesssetupX);
DEBUG(3,("wct=%d flg2=0x%x\n", req->wct, req->flags2));
+ if (req->flags2 & FLAGS2_SMB_SECURITY_SIGNATURES) {
+ signing_allowed = true;
+ }
+ if (req->flags2 & FLAGS2_SMB_SECURITY_SIGNATURES_REQUIRED) {
+ signing_mandatory = true;
+ }
+
+ /*
+ * We can call srv_set_signing_negotiated() each time.
+ * It finds out when it needs to turn into a noop
+ * itself.
+ */
+ srv_set_signing_negotiated(req->sconn,
+ signing_allowed,
+ signing_mandatory);
+
/* a SPNEGO session setup has 12 command words, whereas a normal
NT1 session setup has 13. See the cifs spec. */
if (req->wct == 12 &&