diff options
author | Shirish Pargaonkar <shirishpargaonkar@gmail.com> | 2010-10-21 07:42:55 -0400 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2010-10-26 14:20:10 -0400 |
commit | 21e733930be6458e0c33482b6783e7c15ba984eb (patch) | |
tree | 1458ccf45529649267451a7e06fcd25d9c7ab0ac /fs/cifs/cifspdu.h | |
parent | 6573e9b73e19c0f6b9dfa2b399267ea0f42d6c6b (diff) |
NTLM auth and sign - Allocate session key/client response dynamically
Start calculating auth response within a session. Move/Add pertinet
data structures like session key, server challenge and ntlmv2_hash in
a session structure. We should do the calculations within a session
before copying session key and response over to server data
structures because a session setup can fail.
Only after a very first smb session succeeds, it copy/make its
session key, session key of smb connection. This key stays with
the smb connection throughout its life.
sequence_number within server is set to 0x2.
The authentication Message Authentication Key (mak) which consists
of session key followed by client response within structure session_key
is now dynamic. Every authentication type allocates the key + response
sized memory within its session structure and later either assigns or
frees it once the client response is sent and if session's session key
becomes connetion's session key.
ntlm/ntlmi authentication functions are rearranged. A function
named setup_ntlm_resp(), similar to setup_ntlmv2_resp(), replaces
function cifs_calculate_session_key().
size of CIFS_SESS_KEY_SIZE is changed to 16, to reflect the byte size
of the key it holds.
Reviewed-by: Jeff Layton <jlayton@samba.org>
Signed-off-by: Shirish Pargaonkar <shirishpargaonkar@gmail.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/cifspdu.h')
-rw-r--r-- | fs/cifs/cifspdu.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/cifs/cifspdu.h b/fs/cifs/cifspdu.h index b0f4b5656d4c..a152cd6db99b 100644 --- a/fs/cifs/cifspdu.h +++ b/fs/cifs/cifspdu.h | |||
@@ -131,9 +131,14 @@ | |||
131 | #define CIFS_CRYPTO_KEY_SIZE (8) | 131 | #define CIFS_CRYPTO_KEY_SIZE (8) |
132 | 132 | ||
133 | /* | 133 | /* |
134 | * Size of the ntlm client response | ||
135 | */ | ||
136 | #define CIFS_AUTH_RESP_SIZE (24) | ||
137 | |||
138 | /* | ||
134 | * Size of the session key (crypto key encrypted with the password | 139 | * Size of the session key (crypto key encrypted with the password |
135 | */ | 140 | */ |
136 | #define CIFS_SESS_KEY_SIZE (24) | 141 | #define CIFS_SESS_KEY_SIZE (16) |
137 | 142 | ||
138 | /* | 143 | /* |
139 | * Maximum user name length | 144 | * Maximum user name length |