mirror of
https://github.com/samba-team/samba.git
synced 2025-01-10 01:18:15 +03:00
s4:libcli: add support for SMB_EXTENDED_SIGNATURES during SMBtconX
metze
This commit is contained in:
parent
c32120b4e9
commit
67767de4e9
@ -26,6 +26,7 @@
|
||||
#include "libcli/raw/raw_proto.h"
|
||||
#include "libcli/auth/libcli_auth.h"
|
||||
#include "libcli/smb_composite/smb_composite.h"
|
||||
#include "libcli/smb/smbXcli_base.h"
|
||||
|
||||
/*
|
||||
wrapper around smbcli_sock_connect()
|
||||
@ -125,6 +126,7 @@ NTSTATUS smbcli_tconX(struct smbcli_state *cli, const char *sharename,
|
||||
/* setup a tree connect */
|
||||
tcon.generic.level = RAW_TCON_TCONX;
|
||||
tcon.tconx.in.flags = TCONX_FLAG_EXTENDED_RESPONSE;
|
||||
tcon.tconx.in.flags |= TCONX_FLAG_EXTENDED_SIGNATURES;
|
||||
if (cli->transport->negotiate.sec_mode & NEGOTIATE_SECURITY_USER_LEVEL) {
|
||||
tcon.tconx.in.password = data_blob(NULL, 0);
|
||||
} else if (cli->transport->negotiate.sec_mode & NEGOTIATE_SECURITY_CHALLENGE_RESPONSE) {
|
||||
@ -143,6 +145,10 @@ NTSTATUS smbcli_tconX(struct smbcli_state *cli, const char *sharename,
|
||||
|
||||
cli->tree->tid = tcon.tconx.out.tid;
|
||||
|
||||
if (tcon.tconx.out.options & SMB_EXTENDED_SIGNATURES) {
|
||||
smb1cli_session_protect_session_key(cli->tree->session->smbXcli);
|
||||
}
|
||||
|
||||
talloc_free(mem_ctx);
|
||||
|
||||
return status;
|
||||
|
@ -31,6 +31,7 @@
|
||||
#include "librpc/gen_ndr/ndr_nbt.h"
|
||||
#include "param/param.h"
|
||||
#include "lib/util/util_net.h"
|
||||
#include "libcli/smb/smbXcli_base.h"
|
||||
|
||||
/* the stages of this call */
|
||||
enum connect_stage {CONNECT_SOCKET,
|
||||
@ -72,6 +73,10 @@ static NTSTATUS connect_tcon(struct composite_context *c,
|
||||
status = smb_raw_tcon_recv(state->req, c, state->io_tcon);
|
||||
NT_STATUS_NOT_OK_RETURN(status);
|
||||
|
||||
if (state->io_tcon->tconx.out.options & SMB_EXTENDED_SIGNATURES) {
|
||||
smb1cli_session_protect_session_key(io->out.tree->session->smbXcli);
|
||||
}
|
||||
|
||||
io->out.tree->tid = state->io_tcon->tconx.out.tid;
|
||||
if (state->io_tcon->tconx.out.dev_type) {
|
||||
io->out.tree->device = talloc_strdup(io->out.tree,
|
||||
@ -196,6 +201,7 @@ static NTSTATUS connect_session_setup(struct composite_context *c,
|
||||
/* connect to a share using a tree connect */
|
||||
state->io_tcon->generic.level = RAW_TCON_TCONX;
|
||||
state->io_tcon->tconx.in.flags = TCONX_FLAG_EXTENDED_RESPONSE;
|
||||
state->io_tcon->tconx.in.flags |= TCONX_FLAG_EXTENDED_SIGNATURES;
|
||||
state->io_tcon->tconx.in.password = data_blob(NULL, 0);
|
||||
|
||||
state->io_tcon->tconx.in.path = talloc_asprintf(state->io_tcon,
|
||||
|
@ -32,6 +32,7 @@
|
||||
#include "librpc/gen_ndr/ndr_lsa.h"
|
||||
#include "librpc/gen_ndr/ndr_lsa_c.h"
|
||||
#include "libcli/util/clilsa.h"
|
||||
#include "libcli/smb/smbXcli_base.h"
|
||||
|
||||
struct smblsa_state {
|
||||
struct dcerpc_pipe *pipe;
|
||||
@ -69,6 +70,7 @@ static NTSTATUS smblsa_connect(struct smbcli_state *cli)
|
||||
/* connect to IPC$ */
|
||||
tcon.generic.level = RAW_TCON_TCONX;
|
||||
tcon.tconx.in.flags = TCONX_FLAG_EXTENDED_RESPONSE;
|
||||
tcon.tconx.in.flags |= TCONX_FLAG_EXTENDED_SIGNATURES;
|
||||
tcon.tconx.in.password = data_blob(NULL, 0);
|
||||
tcon.tconx.in.path = "ipc$";
|
||||
tcon.tconx.in.device = "IPC";
|
||||
@ -79,6 +81,10 @@ static NTSTATUS smblsa_connect(struct smbcli_state *cli)
|
||||
}
|
||||
lsa->ipc_tree->tid = tcon.tconx.out.tid;
|
||||
|
||||
if (tcon.tconx.out.options & SMB_EXTENDED_SIGNATURES) {
|
||||
smb1cli_session_protect_session_key(cli->session->smbXcli);
|
||||
}
|
||||
|
||||
lsa->pipe = dcerpc_pipe_init(lsa, cli->transport->ev);
|
||||
if (lsa->pipe == NULL) {
|
||||
talloc_free(lsa);
|
||||
|
Loading…
Reference in New Issue
Block a user