CIFS: Fix signing for SMB2/3
authorAurelien Aptel <aaptel@suse.com>
Mon, 4 Jun 2018 20:29:34 +0000 (22:29 +0200)
committerSteve French <stfrench@microsoft.com>
Tue, 5 Jun 2018 00:17:59 +0000 (19:17 -0500)
commit57f933ce9fba4a1cecb6e34ffafe841d093493cb
tree49c78900055e02d765889b299bde161e5d71288b
parent93e95fa57441b6976b39029bd658b6bbe7ccfe28
CIFS: Fix signing for SMB2/3

It seems Ronnie's preamble removal broke signing.

the signing functions are called when:

A) we send a request (to sign it)
B) when we recv a response (to check the signature).

On code path A, the smb2 header is in iov[1] but on code path B, the
smb2 header is in iov[0] (and there's only one vector).

So we have different iov indexes for the smb2 header but the signing
function always use index 1. Fix this by checking the nb of io vectors
in the signing function as a hint.

Signed-off-by: Aurelien Aptel <aaptel@suse.com>
Reviewed-by: Ronnie Sahlberg <lsahlber@redhat.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/cifs/cifsencrypt.c
fs/cifs/cifsproto.h
fs/cifs/smb2transport.c