From a62f1db2e0b6ec5aba9ee3fa8d9faaad6021d0dc Mon Sep 17 00:00:00 2001 From: Steve French Date: Fri, 31 Mar 2006 21:22:00 +0000 Subject: [PATCH] --- yaml --- r: 24991 b: refs/heads/master c: e9917a000fcc370408c8b7b83f2e85dba5fffbd4 h: refs/heads/master i: 24989: b273418105653dbc08497c5908fae0d9aa9aeca9 24987: 05ce5d0b9634e0a0c61e8cae38c91e84c4bf1f48 24983: be2f3c4a873b61927c2db12fedda7e6940125d5d 24975: 2d83faa7e115235ff88e3e6e6c0623334f77d7ee 24959: 45705f4983bc0fc7155ad092428cb9e2157012a9 v: v3 --- [refs] | 2 +- trunk/fs/cifs/cifsencrypt.c | 36 +++++++++++++++++++++++------------- 2 files changed, 24 insertions(+), 14 deletions(-) diff --git a/[refs] b/[refs] index e1e67f947abd..68e80afbba69 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: f1682e94a38b66ee2551f3a5e4b36259a561c411 +refs/heads/master: e9917a000fcc370408c8b7b83f2e85dba5fffbd4 diff --git a/trunk/fs/cifs/cifsencrypt.c b/trunk/fs/cifs/cifsencrypt.c index c2cbe0ed98b3..e7d63737e651 100644 --- a/trunk/fs/cifs/cifsencrypt.c +++ b/trunk/fs/cifs/cifsencrypt.c @@ -57,9 +57,6 @@ int cifs_sign_smb(struct smb_hdr * cifs_pdu, struct TCP_Server_Info * server, int rc = 0; char smb_signature[20]; - /* BB remember to initialize sequence number elsewhere and initialize mac_signing key elsewhere BB */ - /* BB remember to add code to save expected sequence number in midQ entry BB */ - if((cifs_pdu == NULL) || (server == NULL)) return -EINVAL; @@ -86,20 +83,33 @@ int cifs_sign_smb(struct smb_hdr * cifs_pdu, struct TCP_Server_Info * server, static int cifs_calc_signature2(const struct kvec * iov, int n_vec, const char * key, char * signature) { - struct MD5Context context; - - if((iov == NULL) || (signature == NULL)) - return -EINVAL; + struct MD5Context context; + int i; - MD5Init(&context); - MD5Update(&context,key,CIFS_SESSION_KEY_SIZE+16); + if((iov == NULL) || (signature == NULL)) + return -EINVAL; -/* MD5Update(&context,cifs_pdu->Protocol,cifs_pdu->smb_buf_length); */ /* BB FIXME BB */ + MD5Init(&context); + MD5Update(&context,key,CIFS_SESSION_KEY_SIZE+16); + for(i=0;i