summaryrefslogtreecommitdiff
path: root/libcli/smb
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2012-04-16 12:41:30 +0200
committerStefan Metzmacher <metze@samba.org>2012-04-16 12:54:52 +0200
commitc60c2c5d94c98e8c2888d912712e0d2155ab7fe7 (patch)
tree1c6f286cd5487737e80f6432b03e1a47a5c38167 /libcli/smb
parentb23f5a9418e8acca035930e031c4624478a3d8a9 (diff)
downloadsamba-c60c2c5d94c98e8c2888d912712e0d2155ab7fe7.tar.gz
samba-c60c2c5d94c98e8c2888d912712e0d2155ab7fe7.tar.bz2
samba-c60c2c5d94c98e8c2888d912712e0d2155ab7fe7.zip
libcli/smb: we should not force a session key for anonymous connections
smb2cli_session_set_session_key() should not check for a valid session key, if the connection is a guest or null session. metze
Diffstat (limited to 'libcli/smb')
-rw-r--r--libcli/smb/smbXcli_base.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libcli/smb/smbXcli_base.c b/libcli/smb/smbXcli_base.c
index 67ab3d0565..9b924ad747 100644
--- a/libcli/smb/smbXcli_base.c
+++ b/libcli/smb/smbXcli_base.c
@@ -4121,10 +4121,6 @@ NTSTATUS smb2cli_session_set_session_key(struct smbXcli_session *session,
return NT_STATUS_INVALID_PARAMETER_MIX;
}
- if (session->smb2.signing_key.length != 0) {
- return NT_STATUS_INVALID_PARAMETER_MIX;
- }
-
no_sign_flags = SMB2_SESSION_FLAG_IS_GUEST | SMB2_SESSION_FLAG_IS_NULL;
if (session->smb2.session_flags & no_sign_flags) {
@@ -4132,6 +4128,10 @@ NTSTATUS smb2cli_session_set_session_key(struct smbXcli_session *session,
return NT_STATUS_OK;
}
+ if (session->smb2.signing_key.length != 0) {
+ return NT_STATUS_INVALID_PARAMETER_MIX;
+ }
+
ZERO_STRUCT(session_key);
memcpy(session_key, _session_key.data,
MIN(_session_key.length, sizeof(session_key)));