aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/transport.c
diff options
context:
space:
mode:
authorSteve French <smfrench@austin.rr.com>2005-04-29 01:41:05 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-29 01:41:05 -0400
commitad009ac96509e005d9978d0ae9e9ec4d63ad2990 (patch)
treeeb15ee8333fd7b5816f8fe3d02250ff99601eba0 /fs/cifs/transport.c
parentc67593a03129967eae8939c4899767182eb6d6cd (diff)
[PATCH] cifs: Fix multiuser packet signing to use the right sequence number and mac session key
Signed-off-by: Steve French (sfrench@us.ibm.com) Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/cifs/transport.c')
-rw-r--r--fs/cifs/transport.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/fs/cifs/transport.c b/fs/cifs/transport.c
index af13e526b150..a9e4f989b7f7 100644
--- a/fs/cifs/transport.c
+++ b/fs/cifs/transport.c
@@ -346,7 +346,7 @@ CIFSSendRcv(const unsigned int xid, struct cifsSesInfo *ses,
346 } 346 }
347 347
348 /* BB can we sign efficiently in this path? */ 348 /* BB can we sign efficiently in this path? */
349 rc = cifs_sign_smb(in_buf, ses, &midQ->sequence_number); 349 rc = cifs_sign_smb(in_buf, ses->server, &midQ->sequence_number);
350 350
351 midQ->midState = MID_REQUEST_SUBMITTED; 351 midQ->midState = MID_REQUEST_SUBMITTED;
352/* rc = smb_sendv(ses->server->ssocket, in_buf, in_buf->smb_buf_length, piovec, 352/* rc = smb_sendv(ses->server->ssocket, in_buf, in_buf->smb_buf_length, piovec,
@@ -475,7 +475,7 @@ SendReceive(const unsigned int xid, struct cifsSesInfo *ses,
475 return -EIO; 475 return -EIO;
476 } 476 }
477 477
478 rc = cifs_sign_smb(in_buf, ses, &midQ->sequence_number); 478 rc = cifs_sign_smb(in_buf, ses->server, &midQ->sequence_number);
479 479
480 midQ->midState = MID_REQUEST_SUBMITTED; 480 midQ->midState = MID_REQUEST_SUBMITTED;
481 rc = smb_send(ses->server->ssocket, in_buf, in_buf->smb_buf_length, 481 rc = smb_send(ses->server->ssocket, in_buf, in_buf->smb_buf_length,
@@ -559,8 +559,7 @@ SendReceive(const unsigned int xid, struct cifsSesInfo *ses,
559 } 559 }
560 560
561 if (receive_len > CIFSMaxBufSize + MAX_CIFS_HDR_SIZE) { 561 if (receive_len > CIFSMaxBufSize + MAX_CIFS_HDR_SIZE) {
562 cERROR(1, 562 cERROR(1, ("Frame too large received. Length: %d Xid: %d",
563 ("Frame too large received. Length: %d Xid: %d",
564 receive_len, xid)); 563 receive_len, xid));
565 rc = -EIO; 564 rc = -EIO;
566 } else { /* rcvd frame is ok */ 565 } else { /* rcvd frame is ok */
@@ -575,15 +574,20 @@ SendReceive(const unsigned int xid, struct cifsSesInfo *ses,
575 dump_smb(out_buf, 92); 574 dump_smb(out_buf, 92);
576 /* convert the length into a more usable form */ 575 /* convert the length into a more usable form */
577 if((receive_len > 24) && 576 if((receive_len > 24) &&
578 (ses->server->secMode & (SECMODE_SIGN_REQUIRED | SECMODE_SIGN_ENABLED))) { 577 (ses->server->secMode & (SECMODE_SIGN_REQUIRED |
579 rc = cifs_verify_signature(out_buf, ses->mac_signing_key,midQ->sequence_number); /* BB fix BB */ 578 SECMODE_SIGN_ENABLED))) {
580 if(rc) 579 rc = cifs_verify_signature(out_buf,
581 cFYI(1,("Unexpected signature received from server")); 580 ses->server->mac_signing_key,
581 midQ->sequence_number+1);
582 if(rc) {
583 cERROR(1,("Unexpected packet signature received from server"));
584 /* BB FIXME - add code to kill session here */
585 }
582 } 586 }
583 587
584 *pbytes_returned = out_buf->smb_buf_length; 588 *pbytes_returned = out_buf->smb_buf_length;
585 589
586 /* BB special case reconnect tid and reconnect uid here? */ 590 /* BB special case reconnect tid and uid here? */
587 rc = map_smb_to_linux_error(out_buf); 591 rc = map_smb_to_linux_error(out_buf);
588 592
589 /* convert ByteCount if necessary */ 593 /* convert ByteCount if necessary */