server->secType = NTLM; /* BB override default for NTLMv2 or krb*/ /* one byte - no need to convert this or EncryptionKeyLen from le,*/ 
server->secType = NTLM; /* BB override default for NTLMv2 or kerberos v5 */ /* one byte - no need to convert this or EncryptionKeyLen from little endian */ 
CIFSSMBNegotiate(unsigned int xid, struct cifsSesInfo *ses){	NEGOTIATE_REQ *pSMB;	NEGOTIATE_RSP *pSMBr;	int rc = 0;	int bytes_returned;	struct TCP_Server_Info * server;	u16 count;	if(ses->server)		server = ses->server;	else {		rc = -EIO;		return rc;	}	rc = smb_init(SMB_COM_NEGOTIATE, 0, NULL /* no tcon yet */ ,		      (void **) &pSMB, (void **) &pSMBr);	if (rc)		return rc;	pSMB->hdr.Flags2 |= SMBFLG2_UNICODE;	if (extended_security)		pSMB->hdr.Flags2 |= SMBFLG2_EXT_SEC;	count = strlen(protocols[0].name) + 1;	strncpy(pSMB->DialectsArray, protocols[0].name, 30);	    /* null guaranteed to be at end of source and target buffers anyway */	pSMB->hdr.smb_buf_length += count;	pSMB->ByteCount = cpu_to_le16(count);	rc = SendReceive(xid, ses, (struct smb_hdr *) pSMB,			 (struct smb_hdr *) pSMBr, &bytes_returned, 0);	if (rc == 0) {		server->secMode = pSMBr->SecurityMode;			server->secType = NTLM; /* BB override default for NTLMv2 or krb*/		/* one byte - no need to convert this or EncryptionKeyLen from le,*/		server->maxReq = le16_to_cpu(pSMBr->MaxMpxCount);		/* probably no need to store and check maxvcs */		server->maxBuf =			min(le32_to_cpu(pSMBr->MaxBufferSize),			(__u32) CIFSMaxBufSize + MAX_CIFS_HDR_SIZE);		server->maxRw = le32_to_cpu(pSMBr->MaxRawSize);		cFYI(0, ("Max buf = %d ", ses->server->maxBuf));		GETU32(ses->server->sessid) = le32_to_cpu(pSMBr->SessionKey);		server->capabilities = le32_to_cpu(pSMBr->Capabilities);		server->timeZone = le16_to_cpu(pSMBr->ServerTimeZone);	        /* BB with UTC do we ever need to be using srvr timezone? */		if (pSMBr->EncryptionKeyLength == CIFS_CRYPTO_KEY_SIZE) {			memcpy(server->cryptKey, pSMBr->u.EncryptionKey,			       CIFS_CRYPTO_KEY_SIZE);		} else if ((pSMBr->hdr.Flags2 & SMBFLG2_EXT_SEC)			   && (pSMBr->EncryptionKeyLength == 0)) {			/* decode security blob */		} else			rc = -EIO;		/* BB might be helpful to save off the domain of server here */		if ((pSMBr->hdr.Flags2 & SMBFLG2_EXT_SEC) && 			(server->capabilities & CAP_EXTENDED_SECURITY)) {			count = pSMBr->ByteCount;			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,							("UID of server does not match previous connection to same ip address"));						memcpy(server->							server_GUID,							pSMBr->u.							extended_response.							GUID, 16);					}				} else					memcpy(server->server_GUID,					       pSMBr->u.extended_response.					       GUID, 16);			} else {				rc = decode_negTokenInit(pSMBr->u.							 extended_response.							 SecurityBlob,							 count - 16,							 &server->secType);				if(rc == 1) {				/* BB Need to fill struct for sessetup here */					rc = -EOPNOTSUPP;				} else {					rc = -EINVAL;				}			}		} else			server->capabilities &= ~CAP_EXTENDED_SECURITY;		if(sign_CIFS_PDUs == FALSE) {        			if(server->secMode & SECMODE_SIGN_REQUIRED)				cERROR(1,				 ("Server requires /proc/fs/cifs/PacketSigningEnabled"));			server->secMode &= ~(SECMODE_SIGN_ENABLED | SECMODE_SIGN_REQUIRED);		} else if(sign_CIFS_PDUs == 1) {			if((server->secMode & SECMODE_SIGN_REQUIRED) == 0)				server->secMode &= ~(SECMODE_SIGN_ENABLED | SECMODE_SIGN_REQUIRED);		}					}	if (pSMB)		cifs_buf_release(pSMB);	return rc;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/09d1db5c6131232f764046160c29118cd4e5e646/cifssmb.c/buggy/fs/cifs/cifssmb.c