summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2012-02-27 09:29:53 +0100
committerStefan Metzmacher <metze@samba.org>2012-02-27 14:26:32 +0100
commit615c41ce128233c90bc77fc413fdcdc92c1cad50 (patch)
tree7613cd6ba37953790ef2c02d867899da06e99a4c
parent7309e11ad58eb562859190ce99cb51ecbacbc540 (diff)
downloadsamba-615c41ce128233c90bc77fc413fdcdc92c1cad50.tar.gz
samba-615c41ce128233c90bc77fc413fdcdc92c1cad50.tar.bz2
samba-615c41ce128233c90bc77fc413fdcdc92c1cad50.zip
libcli/smb/smb2_signing: pass down 'protocol' to smb2_signing_[sign|check]_pdu()
metze Autobuild-User: Stefan Metzmacher <metze@samba.org> Autobuild-Date: Mon Feb 27 14:26:32 CET 2012 on sn-devel-104
-rw-r--r--libcli/smb/smb2_signing.c2
-rw-r--r--libcli/smb/smb2_signing.h2
-rw-r--r--libcli/smb/smbXcli_base.c7
-rw-r--r--libcli/smb/smb_common.h2
-rw-r--r--source3/smbd/smb2_server.c4
5 files changed, 15 insertions, 2 deletions
diff --git a/libcli/smb/smb2_signing.c b/libcli/smb/smb2_signing.c
index d3ff4c04e7..30172772b7 100644
--- a/libcli/smb/smb2_signing.c
+++ b/libcli/smb/smb2_signing.c
@@ -24,6 +24,7 @@
#include "../lib/crypto/crypto.h"
NTSTATUS smb2_signing_sign_pdu(DATA_BLOB signing_key,
+ enum protocol_types protocol,
struct iovec *vector,
int count)
{
@@ -77,6 +78,7 @@ NTSTATUS smb2_signing_sign_pdu(DATA_BLOB signing_key,
}
NTSTATUS smb2_signing_check_pdu(DATA_BLOB signing_key,
+ enum protocol_types protocol,
const struct iovec *vector,
int count)
{
diff --git a/libcli/smb/smb2_signing.h b/libcli/smb/smb2_signing.h
index dcabcaad09..ba2b1ca302 100644
--- a/libcli/smb/smb2_signing.h
+++ b/libcli/smb/smb2_signing.h
@@ -24,10 +24,12 @@
struct iovec;
NTSTATUS smb2_signing_sign_pdu(DATA_BLOB signing_key,
+ enum protocol_types protocol,
struct iovec *vector,
int count);
NTSTATUS smb2_signing_check_pdu(DATA_BLOB signing_key,
+ enum protocol_types protocol,
const struct iovec *vector,
int count);
diff --git a/libcli/smb/smbXcli_base.c b/libcli/smb/smbXcli_base.c
index 6b4458878b..f47659dd03 100644
--- a/libcli/smb/smbXcli_base.c
+++ b/libcli/smb/smbXcli_base.c
@@ -2623,6 +2623,7 @@ skip_credits:
NTSTATUS status;
status = smb2_signing_sign_pdu(*signing_key,
+ state->session->conn->protocol,
&iov[hdr_iov], num_iov - hdr_iov);
if (!NT_STATUS_IS_OK(status)) {
return status;
@@ -3046,7 +3047,9 @@ static NTSTATUS smb2cli_conn_dispatch_incoming(struct smbXcli_conn *conn,
}
if (signing_key) {
- status = smb2_signing_check_pdu(*signing_key, cur, 3);
+ status = smb2_signing_check_pdu(*signing_key,
+ state->conn->protocol,
+ cur, 3);
if (!NT_STATUS_IS_OK(status)) {
/*
* If the signing check fails, we disconnect
@@ -4147,6 +4150,7 @@ NTSTATUS smb2cli_session_set_session_key(struct smbXcli_session *session,
}
status = smb2_signing_check_pdu(session->smb2.channel_signing_key,
+ session->conn->protocol,
recv_iov, 3);
if (!NT_STATUS_IS_OK(status)) {
return status;
@@ -4232,6 +4236,7 @@ NTSTATUS smb2cli_session_set_channel_key(struct smbXcli_session *session,
}
status = smb2_signing_check_pdu(session->smb2.channel_signing_key,
+ session->conn->protocol,
recv_iov, 3);
if (!NT_STATUS_IS_OK(status)) {
return status;
diff --git a/libcli/smb/smb_common.h b/libcli/smb/smb_common.h
index 1f21e553ba..47a336a38f 100644
--- a/libcli/smb/smb_common.h
+++ b/libcli/smb/smb_common.h
@@ -22,10 +22,10 @@
#ifndef __LIBCLI_SMB_SMB_COMMON_H__
#define __LIBCLI_SMB_SMB_COMMON_H__
+#include "libcli/smb/smb_constants.h"
#include "libcli/smb/smb2_constants.h"
#include "libcli/smb/smb2_create_blob.h"
#include "libcli/smb/smb2_signing.h"
-#include "libcli/smb/smb_constants.h"
#include "libcli/smb/smb_util.h"
#include "libcli/smb/smb_unix_ext.h"
diff --git a/source3/smbd/smb2_server.c b/source3/smbd/smb2_server.c
index 899de07c23..7233e09bd2 100644
--- a/source3/smbd/smb2_server.c
+++ b/source3/smbd/smb2_server.c
@@ -786,6 +786,7 @@ static NTSTATUS smb2_send_async_interim_response(const struct smbd_smb2_request
if (nreq->do_signing) {
NTSTATUS status;
status = smb2_signing_sign_pdu(nreq->session->session_key,
+ get_Protocol(),
&nreq->out.vector[i], 3);
if (!NT_STATUS_IS_OK(status)) {
return status;
@@ -1071,6 +1072,7 @@ static void smbd_smb2_request_pending_timer(struct tevent_context *ev,
NTSTATUS status;
status = smb2_signing_sign_pdu(req->session->session_key,
+ get_Protocol(),
&state->vector[1], 2);
if (!NT_STATUS_IS_OK(status)) {
smbd_server_connection_terminate(req->sconn,
@@ -1376,6 +1378,7 @@ NTSTATUS smbd_smb2_request_dispatch(struct smbd_smb2_request *req)
req->do_signing = true;
status = smb2_signing_check_pdu(req->session->session_key,
+ get_Protocol(),
&req->in.vector[i], 3);
if (!NT_STATUS_IS_OK(status)) {
return smbd_smb2_request_error(req, status);
@@ -1865,6 +1868,7 @@ static NTSTATUS smbd_smb2_request_reply(struct smbd_smb2_request *req)
if (req->do_signing) {
NTSTATUS status;
status = smb2_signing_sign_pdu(req->session->session_key,
+ get_Protocol(),
&req->out.vector[i], 3);
if (!NT_STATUS_IS_OK(status)) {
return status;