diff options
author | Steve French <sfrench@us.ibm.com> | 2006-06-02 18:57:13 -0400 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2006-06-02 18:57:13 -0400 |
commit | bdc4bf6e8ac8cc29c61c2f0dc61d9776ef9a8ed4 (patch) | |
tree | 60e8cd01fa1a5a8c5bc00c920db629232191ccf1 /fs/cifs/cifsencrypt.c | |
parent | 43411d699e8cf3293674da558d31a02e0012aa9d (diff) |
[CIFS] Support for older servers which require plaintext passwords
disabled by default, but can be enabled via proc for servers which
require such support. Also includes support for setting security
flags for cifs. See fs/cifs/README
Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/cifsencrypt.c')
-rw-r--r-- | fs/cifs/cifsencrypt.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/fs/cifs/cifsencrypt.c b/fs/cifs/cifsencrypt.c index e11d8c6bb227..3ae964bbfdc3 100644 --- a/fs/cifs/cifsencrypt.c +++ b/fs/cifs/cifsencrypt.c | |||
@@ -271,9 +271,18 @@ void calc_lanman_hash(struct cifsSesInfo * ses, char * lnm_session_key) | |||
271 | int i; | 271 | int i; |
272 | char password_with_pad[CIFS_ENCPWD_SIZE]; | 272 | char password_with_pad[CIFS_ENCPWD_SIZE]; |
273 | 273 | ||
274 | if(ses->server == NULL) | ||
275 | return; | ||
276 | |||
274 | memset(password_with_pad, 0, CIFS_ENCPWD_SIZE); | 277 | memset(password_with_pad, 0, CIFS_ENCPWD_SIZE); |
275 | strncpy(password_with_pad, ses->password, CIFS_ENCPWD_SIZE); | 278 | strncpy(password_with_pad, ses->password, CIFS_ENCPWD_SIZE); |
276 | 279 | ||
280 | if((ses->server->secMode & SECMODE_PW_ENCRYPT) == 0) | ||
281 | if(extended_security & CIFSSEC_MAY_PLNTXT) { | ||
282 | memcpy(lnm_session_key, password_with_pad, CIFS_ENCPWD_SIZE); | ||
283 | return; | ||
284 | } | ||
285 | |||
277 | /* calculate old style session key */ | 286 | /* calculate old style session key */ |
278 | /* calling toupper is less broken than repeatedly | 287 | /* calling toupper is less broken than repeatedly |
279 | calling nls_toupper would be since that will never | 288 | calling nls_toupper would be since that will never |