diff options
author | Andreas Schneider <asn@samba.org> | 2019-06-11 15:39:24 +0200 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2019-06-11 14:01:20 +0000 |
commit | 1817db965dc0caf55e4308fa4d9203ab4381dc90 (patch) | |
tree | baaf7e58b46c2e0f32c1f075317c50d7181124e3 /libcli | |
parent | 4646698f1b040e743180b7d43578c31d6a28983e (diff) | |
download | samba-1817db965dc0caf55e4308fa4d9203ab4381dc90.tar.gz |
libcli:smb: Fix signing with multichannel
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'libcli')
-rw-r--r-- | libcli/smb/smbXcli_base.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/libcli/smb/smbXcli_base.c b/libcli/smb/smbXcli_base.c index a82146a60f4..e916a17e07a 100644 --- a/libcli/smb/smbXcli_base.c +++ b/libcli/smb/smbXcli_base.c @@ -3282,7 +3282,8 @@ skip_credits: * If it is a channel binding, we already have the main * signing key and try that one. */ - if (!smb2_signing_key_valid(signing_key)) { + if (signing_key != NULL && + !smb2_signing_key_valid(signing_key)) { signing_key = state->session->smb2->signing_key; } @@ -3290,7 +3291,8 @@ skip_credits: * If we do not have any session key yet, we skip the * signing of SMB2_OP_SESSSETUP requests. */ - if (!smb2_signing_key_valid(signing_key)) { + if (signing_key != NULL && + !smb2_signing_key_valid(signing_key)) { signing_key = NULL; } } @@ -3789,12 +3791,14 @@ static NTSTATUS smb2cli_conn_dispatch_incoming(struct smbXcli_conn *conn, * we try the main signing key, if it is not * the final response. */ - if (!smb2_signing_key_valid(signing_key) && + if (signing_key != NULL && + !smb2_signing_key_valid(signing_key) && !NT_STATUS_IS_OK(status)) { signing_key = session->smb2->signing_key; } - if (!smb2_signing_key_valid(signing_key)) { + if (signing_key != NULL && + !smb2_signing_key_valid(signing_key)) { /* * If we do not have a session key to * verify the signature, we defer the |