Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e187e44e authored by Jeff Layton's avatar Jeff Layton Committed by Steve French
Browse files

[CIFS] parse server_GUID in SPNEGO negProt response



SPNEGO NegProt response also contains a server_GUID. Parse it as we
would for RawNTLMSSP.

Signed-off-by: default avatarJeff Layton <jlayton@redhat.com>
Signed-off-by: default avatarSteve French <sfrench@us.ibm.com>
parent 7111d214
Loading
Loading
Loading
Loading
+18 −14
Original line number Original line Diff line number Diff line
@@ -621,10 +621,11 @@ CIFSSMBNegotiate(unsigned int xid, struct cifsSesInfo *ses)
	if ((pSMBr->hdr.Flags2 & SMBFLG2_EXT_SEC) &&
	if ((pSMBr->hdr.Flags2 & SMBFLG2_EXT_SEC) &&
		(server->capabilities & CAP_EXTENDED_SECURITY)) {
		(server->capabilities & CAP_EXTENDED_SECURITY)) {
		count = pSMBr->ByteCount;
		count = pSMBr->ByteCount;
		if (count < 16)
		if (count < 16) {
			rc = -EIO;
			rc = -EIO;
		else if (count == 16) {
			goto neg_err_exit;
			server->secType = RawNTLMSSP;
		}

		if (server->socketUseCount.counter > 1) {
		if (server->socketUseCount.counter > 1) {
			if (memcmp(server->server_GUID,
			if (memcmp(server->server_GUID,
				   pSMBr->u.extended_response.
				   pSMBr->u.extended_response.
@@ -637,6 +638,9 @@ CIFSSMBNegotiate(unsigned int xid, struct cifsSesInfo *ses)
		} else
		} else
			memcpy(server->server_GUID,
			memcpy(server->server_GUID,
			       pSMBr->u.extended_response.GUID, 16);
			       pSMBr->u.extended_response.GUID, 16);

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