diff options
author | Jeff Layton <jlayton@redhat.com> | 2008-12-05 20:41:21 -0500 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2008-12-25 21:29:11 -0500 |
commit | 4e53a3fb98d3d5c2941d2e7199dab317a9d4ead3 (patch) | |
tree | c3485a826f33e4b6f18b603a475a1bfef7bb7986 /fs/cifs/smbencrypt.c | |
parent | 55162dec9371a6f6ac63ff546c182cc6144a649e (diff) |
cifs: have calc_lanman_hash take more granular args
cifs: have calc_lanman_hash take more granular args
We need to use this routine to encrypt passwords associated with the
tcon too. Don't assume that the password will be attached to the
smb_session.
Also, make some of the values in the lower encryption functions
const since they aren't changed.
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/smbencrypt.c')
-rw-r--r-- | fs/cifs/smbencrypt.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/fs/cifs/smbencrypt.c b/fs/cifs/smbencrypt.c index ff3232fa1015..93fb09a99c69 100644 --- a/fs/cifs/smbencrypt.c +++ b/fs/cifs/smbencrypt.c | |||
@@ -49,9 +49,10 @@ | |||
49 | 49 | ||
50 | /*The following definitions come from libsmb/smbencrypt.c */ | 50 | /*The following definitions come from libsmb/smbencrypt.c */ |
51 | 51 | ||
52 | void SMBencrypt(unsigned char *passwd, unsigned char *c8, unsigned char *p24); | 52 | void SMBencrypt(unsigned char *passwd, const unsigned char *c8, |
53 | unsigned char *p24); | ||
53 | void E_md4hash(const unsigned char *passwd, unsigned char *p16); | 54 | void E_md4hash(const unsigned char *passwd, unsigned char *p16); |
54 | static void SMBOWFencrypt(unsigned char passwd[16], unsigned char *c8, | 55 | static void SMBOWFencrypt(unsigned char passwd[16], const unsigned char *c8, |
55 | unsigned char p24[24]); | 56 | unsigned char p24[24]); |
56 | void SMBNTencrypt(unsigned char *passwd, unsigned char *c8, unsigned char *p24); | 57 | void SMBNTencrypt(unsigned char *passwd, unsigned char *c8, unsigned char *p24); |
57 | 58 | ||
@@ -61,7 +62,7 @@ void SMBNTencrypt(unsigned char *passwd, unsigned char *c8, unsigned char *p24); | |||
61 | encrypted password into p24 */ | 62 | encrypted password into p24 */ |
62 | /* Note that password must be uppercased and null terminated */ | 63 | /* Note that password must be uppercased and null terminated */ |
63 | void | 64 | void |
64 | SMBencrypt(unsigned char *passwd, unsigned char *c8, unsigned char *p24) | 65 | SMBencrypt(unsigned char *passwd, const unsigned char *c8, unsigned char *p24) |
65 | { | 66 | { |
66 | unsigned char p14[15], p21[21]; | 67 | unsigned char p14[15], p21[21]; |
67 | 68 | ||
@@ -212,7 +213,7 @@ ntv2_owf_gen(const unsigned char owf[16], const char *user_n, | |||
212 | 213 | ||
213 | /* Does the des encryption from the NT or LM MD4 hash. */ | 214 | /* Does the des encryption from the NT or LM MD4 hash. */ |
214 | static void | 215 | static void |
215 | SMBOWFencrypt(unsigned char passwd[16], unsigned char *c8, | 216 | SMBOWFencrypt(unsigned char passwd[16], const unsigned char *c8, |
216 | unsigned char p24[24]) | 217 | unsigned char p24[24]) |
217 | { | 218 | { |
218 | unsigned char p21[21]; | 219 | unsigned char p21[21]; |