Skip to content

Commit

Permalink
[CIFS] parse server_GUID in SPNEGO negProt response
Browse files Browse the repository at this point in the history
SPNEGO NegProt response also contains a server_GUID. Parse it as we
would for RawNTLMSSP.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
  • Loading branch information
Jeff Layton authored and Steve French committed Oct 16, 2007
1 parent 7111d21 commit e187e44
Showing 1 changed file with 18 additions and 14 deletions.
32 changes: 18 additions & 14 deletions fs/cifs/cifssmb.c
Original file line number Diff line number Diff line change
Expand Up @@ -621,22 +621,26 @@ CIFSSMBNegotiate(unsigned int xid, struct cifsSesInfo *ses)
if ((pSMBr->hdr.Flags2 & SMBFLG2_EXT_SEC) &&
(server->capabilities & CAP_EXTENDED_SECURITY)) {
count = pSMBr->ByteCount;
if (count < 16)
if (count < 16) {
rc = -EIO;
else if (count == 16) {
server->secType = RawNTLMSSP;
if (server->socketUseCount.counter > 1) {
if (memcmp(server->server_GUID,
pSMBr->u.extended_response.
GUID, 16) != 0) {
cFYI(1, ("server UID changed"));
memcpy(server->server_GUID,
pSMBr->u.extended_response.GUID,
16);
}
} else
goto neg_err_exit;
}

if (server->socketUseCount.counter > 1) {
if (memcmp(server->server_GUID,
pSMBr->u.extended_response.
GUID, 16) != 0) {
cFYI(1, ("server UID changed"));
memcpy(server->server_GUID,
pSMBr->u.extended_response.GUID, 16);
pSMBr->u.extended_response.GUID,
16);
}
} else
memcpy(server->server_GUID,
pSMBr->u.extended_response.GUID, 16);

if (count == 16) {
server->secType = RawNTLMSSP;
} else {
rc = decode_negTokenInit(pSMBr->u.extended_response.
SecurityBlob,
Expand Down

0 comments on commit e187e44

Please sign in to comment.