summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2014-06-11 12:42:56 +0200
committerMichael Adam <obnox@samba.org>2014-08-06 09:51:13 +0200
commit05779e318a0afbd6e2949167fe6e766c6bbe7932 (patch)
treea710b2192e1e128b98bf4a6403d426eb6ce4a6d0 /source3
parente9fb54c1ec977e5e16733b8ccc0d9de5e4d4d83f (diff)
downloadsamba-05779e318a0afbd6e2949167fe6e766c6bbe7932.tar.gz
s3:smbd: pass smbXsrv_connection to get_challenge()
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
Diffstat (limited to 'source3')
-rw-r--r--source3/smbd/negprot.c24
1 files changed, 10 insertions, 14 deletions
diff --git a/source3/smbd/negprot.c b/source3/smbd/negprot.c
index 7db714d7f6f..86a4acd7d36 100644
--- a/source3/smbd/negprot.c
+++ b/source3/smbd/negprot.c
@@ -31,9 +31,8 @@
extern fstring remote_proto;
-static void get_challenge(struct smbd_server_connection *sconn, uint8 buff[8])
+static void get_challenge(struct smbXsrv_connection *xconn, uint8 buff[8])
{
- struct smbXsrv_connection *xconn = sconn->conn;
NTSTATUS nt_status;
/* We might be called more than once, multiple negprots are
@@ -65,8 +64,7 @@ static void reply_lanman1(struct smb_request *req, uint16 choice)
{
int secword=0;
time_t t = time(NULL);
- struct smbd_server_connection *sconn = req->sconn;
- struct smbXsrv_connection *xconn = sconn->conn;
+ struct smbXsrv_connection *xconn = req->xconn;
uint16_t raw;
if (lp_async_smb_echo_handler()) {
raw = 0;
@@ -87,11 +85,11 @@ static void reply_lanman1(struct smb_request *req, uint16 choice)
SSVAL(req->outbuf,smb_vwv1,secword);
/* Create a token value and add it to the outgoing packet. */
if (xconn->smb1.negprot.encrypted_passwords) {
- get_challenge(sconn, (uint8 *)smb_buf(req->outbuf));
+ get_challenge(xconn, (uint8 *)smb_buf(req->outbuf));
SSVAL(req->outbuf,smb_vwv11, 8);
}
- smbXsrv_connection_init_tables(req->sconn->conn, PROTOCOL_LANMAN1);
+ smbXsrv_connection_init_tables(xconn, PROTOCOL_LANMAN1);
/* Reply, SMBlockread, SMBwritelock supported. */
SCVAL(req->outbuf,smb_flg, FLAG_REPLY|FLAG_SUPPORT_LOCKREAD);
@@ -116,8 +114,7 @@ static void reply_lanman2(struct smb_request *req, uint16 choice)
{
int secword=0;
time_t t = time(NULL);
- struct smbd_server_connection *sconn = req->sconn;
- struct smbXsrv_connection *xconn = sconn->conn;
+ struct smbXsrv_connection *xconn = req->xconn;
uint16_t raw;
if (lp_async_smb_echo_handler()) {
raw = 0;
@@ -140,11 +137,11 @@ static void reply_lanman2(struct smb_request *req, uint16 choice)
/* Create a token value and add it to the outgoing packet. */
if (xconn->smb1.negprot.encrypted_passwords) {
- get_challenge(sconn, (uint8 *)smb_buf(req->outbuf));
+ get_challenge(xconn, (uint8 *)smb_buf(req->outbuf));
SSVAL(req->outbuf,smb_vwv11, 8);
}
- smbXsrv_connection_init_tables(req->sconn->conn, PROTOCOL_LANMAN2);
+ smbXsrv_connection_init_tables(xconn, PROTOCOL_LANMAN2);
/* Reply, SMBlockread, SMBwritelock supported. */
SCVAL(req->outbuf,smb_flg,FLAG_REPLY|FLAG_SUPPORT_LOCKREAD);
@@ -252,7 +249,6 @@ static void reply_nt1(struct smb_request *req, uint16 choice)
bool negotiate_spnego = False;
struct timespec ts;
ssize_t ret;
- struct smbd_server_connection *sconn = req->sconn;
struct smbXsrv_connection *xconn = req->xconn;
bool signing_desired = false;
bool signing_required = false;
@@ -352,7 +348,7 @@ static void reply_nt1(struct smb_request *req, uint16 choice)
uint8 chal[8];
/* note that we do not send a challenge at all if
we are using plaintext */
- get_challenge(sconn, chal);
+ get_challenge(xconn, chal);
ret = message_push_blob(
&req->outbuf, data_blob_const(chal, sizeof(chal)));
if (ret == -1) {
@@ -520,8 +516,8 @@ void reply_negprot(struct smb_request *req)
char **cliprotos;
int i;
size_t converted_size;
- struct smbd_server_connection *sconn = req->sconn;
- struct smbXsrv_connection *xconn = sconn->conn;
+ struct smbXsrv_connection *xconn = req->xconn;
+ struct smbd_server_connection *sconn = xconn->sconn;
START_PROFILE(SMBnegprot);