diff options
| author | Shirish Pargaonkar <shirishpargaonkar@gmail.com> | 2010-10-19 12:47:52 -0400 |
|---|---|---|
| committer | Steve French <sfrench@us.ibm.com> | 2010-10-19 14:56:42 -0400 |
| commit | 89f150f401c32b0a587dcb98d3bcfafe0b9c1c70 (patch) | |
| tree | cff93486560754e3c4652bf78ddd120daee5ba8c | |
| parent | b33879aa834ebe03ced3dca4e3b822bd8894a474 (diff) | |
Clean up two declarations of blob_len
- Eliminate double declaration of variable blob_len
- Modify function build_ntlmssp_auth_blob to return error code
as well as length of the blob.
Signed-off-by: Shirish Pargaonkar <shirishpargaonkar@gmail.com>
Reviewed-by: Jeff Layton <jlayton@samba.org>
Signed-off-by: Steve French <sfrench@us.ibm.com>
| -rw-r--r-- | fs/cifs/sess.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/fs/cifs/sess.c b/fs/cifs/sess.c index 2111bed71b1f..e35dc60d3255 100644 --- a/fs/cifs/sess.c +++ b/fs/cifs/sess.c | |||
| @@ -464,6 +464,7 @@ static void build_ntlmssp_negotiate_blob(unsigned char *pbuffer, | |||
| 464 | maximum possible size is fixed and small, making this approach cleaner. | 464 | maximum possible size is fixed and small, making this approach cleaner. |
| 465 | This function returns the length of the data in the blob */ | 465 | This function returns the length of the data in the blob */ |
| 466 | static int build_ntlmssp_auth_blob(unsigned char *pbuffer, | 466 | static int build_ntlmssp_auth_blob(unsigned char *pbuffer, |
| 467 | u16 *buflen, | ||
| 467 | struct cifsSesInfo *ses, | 468 | struct cifsSesInfo *ses, |
| 468 | const struct nls_table *nls_cp) | 469 | const struct nls_table *nls_cp) |
| 469 | { | 470 | { |
| @@ -558,7 +559,8 @@ static int build_ntlmssp_auth_blob(unsigned char *pbuffer, | |||
| 558 | sec_blob->SessionKey.MaximumLength = 0; | 559 | sec_blob->SessionKey.MaximumLength = 0; |
| 559 | 560 | ||
| 560 | setup_ntlmv2_ret: | 561 | setup_ntlmv2_ret: |
| 561 | return tmp - pbuffer; | 562 | *buflen = tmp - pbuffer; |
| 563 | return rc; | ||
| 562 | } | 564 | } |
| 563 | 565 | ||
| 564 | 566 | ||
| @@ -591,7 +593,7 @@ CIFS_SessSetup(unsigned int xid, struct cifsSesInfo *ses, | |||
| 591 | int bytes_remaining; | 593 | int bytes_remaining; |
| 592 | struct key *spnego_key = NULL; | 594 | struct key *spnego_key = NULL; |
| 593 | __le32 phase = NtLmNegotiate; /* NTLMSSP, if needed, is multistage */ | 595 | __le32 phase = NtLmNegotiate; /* NTLMSSP, if needed, is multistage */ |
| 594 | int blob_len; | 596 | u16 blob_len; |
| 595 | char *ntlmsspblob = NULL; | 597 | char *ntlmsspblob = NULL; |
| 596 | 598 | ||
| 597 | if (ses == NULL) | 599 | if (ses == NULL) |
| @@ -848,8 +850,10 @@ ssetup_ntlmssp_authenticate: | |||
| 848 | goto ssetup_exit; | 850 | goto ssetup_exit; |
| 849 | } | 851 | } |
| 850 | 852 | ||
| 851 | blob_len = build_ntlmssp_auth_blob(ntlmsspblob, | 853 | rc = build_ntlmssp_auth_blob(ntlmsspblob, |
| 852 | ses, nls_cp); | 854 | &blob_len, ses, nls_cp); |
| 855 | if (rc) | ||
| 856 | goto ssetup_exit; | ||
| 853 | iov[1].iov_len = blob_len; | 857 | iov[1].iov_len = blob_len; |
| 854 | iov[1].iov_base = ntlmsspblob; | 858 | iov[1].iov_base = ntlmsspblob; |
| 855 | pSMB->req.SecurityBlobLength = | 859 | pSMB->req.SecurityBlobLength = |
| @@ -927,7 +931,6 @@ ssetup_ntlmssp_authenticate: | |||
| 927 | bcc_ptr = pByteArea(smb_buf); | 931 | bcc_ptr = pByteArea(smb_buf); |
| 928 | 932 | ||
| 929 | if (smb_buf->WordCount == 4) { | 933 | if (smb_buf->WordCount == 4) { |
| 930 | __u16 blob_len; | ||
| 931 | blob_len = le16_to_cpu(pSMB->resp.SecurityBlobLength); | 934 | blob_len = le16_to_cpu(pSMB->resp.SecurityBlobLength); |
| 932 | if (blob_len > bytes_remaining) { | 935 | if (blob_len > bytes_remaining) { |
| 933 | cERROR(1, "bad security blob length %d", blob_len); | 936 | cERROR(1, "bad security blob length %d", blob_len); |
