Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
c2b0a383
Commit
c2b0a383
authored
Mar 13, 2005
by
Steve French
Committed by
Steve French
Mar 13, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[CIFS] remove sparse warnings
Signed-off-by: Steve French (sfrench@us.ibm.com)
parent
04914174
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
64 additions
and
25 deletions
+64
-25
fs/cifs/cifsencrypt.h
fs/cifs/cifsencrypt.h
+34
-0
fs/cifs/cifsproto.h
fs/cifs/cifsproto.h
+10
-0
fs/cifs/cifssmb.c
fs/cifs/cifssmb.c
+3
-4
fs/cifs/md4.c
fs/cifs/md4.c
+2
-0
fs/cifs/smbdes.c
fs/cifs/smbdes.c
+5
-1
fs/cifs/smbencrypt.c
fs/cifs/smbencrypt.c
+10
-20
No files found.
fs/cifs/cifsencrypt.h
0 → 100644
View file @
c2b0a383
/*
* fs/cifs/cifsencrypt.h
*
* Copyright (c) International Business Machines Corp., 2005
* Author(s): Steve French (sfrench@us.ibm.com)
*
* Externs for misc. small encryption routines
* so we do not have to put them in cifsproto.h
*
* This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation; either version 2.1 of the License, or
* (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
* the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* md4.c */
extern
void
mdfour
(
unsigned
char
*
out
,
unsigned
char
*
in
,
int
n
);
/* smbdes.c */
extern
void
E_P16
(
unsigned
char
*
p14
,
unsigned
char
*
p16
);
extern
void
E_P24
(
unsigned
char
*
p21
,
unsigned
char
*
c8
,
unsigned
char
*
p24
);
extern
void
D_P16
(
unsigned
char
*
p14
,
unsigned
char
*
in
,
unsigned
char
*
out
);
extern
void
E_old_pw_hash
(
unsigned
char
*
p14
,
unsigned
char
*
in
,
unsigned
char
*
out
);
fs/cifs/cifsproto.h
View file @
c2b0a383
...
...
@@ -203,6 +203,16 @@ extern int CIFSSMBWrite(const int xid, struct cifsTconInfo *tcon,
const
__u64
lseek
,
unsigned
int
*
nbytes
,
const
char
*
buf
,
const
char
__user
*
ubuf
,
const
int
long_op
);
#ifdef CONFIG_CIFS_EXPERIMENTAL
extern
int
CIFSSMBWrite2
(
const
int
xid
,
struct
cifsTconInfo
*
tcon
,
const
int
netfid
,
const
unsigned
int
count
,
const
__u64
offset
,
unsigned
int
*
nbytes
,
const
char
__user
*
buf
,
const
int
long_op
);
extern
int
CIFSGetSrvInodeNumber
(
const
int
xid
,
struct
cifsTconInfo
*
tcon
,
const
unsigned
char
*
searchName
,
__u64
*
inode_number
,
const
struct
nls_table
*
nls_codepage
);
#endif
/* CONFIG_CIFS_EXPERIMENTAL */
extern
int
CIFSSMBLock
(
const
int
xid
,
struct
cifsTconInfo
*
tcon
,
const
__u16
netfid
,
const
__u64
len
,
const
__u64
offset
,
const
__u32
numUnlock
,
...
...
fs/cifs/cifssmb.c
View file @
c2b0a383
...
...
@@ -2239,9 +2239,8 @@ CIFSSMBUnixQPathInfo(const int xid, struct cifsTconInfo *tcon,
return
rc
;
}
#ifdef CONFIG_CIFS_EXPERIMENTAL
/* function unused at present */
int
CIFSFindSingle
(
const
int
xid
,
struct
cifsTconInfo
*
tcon
,
#if 0 /* function unused at present */
int CIFSFindSingle(const int xid, struct cifsTconInfo *tcon,
const char *searchName, FILE_ALL_INFO * findData,
const struct nls_table *nls_codepage)
{
...
...
@@ -2318,7 +2317,7 @@ CIFSFindSingle(const int xid, struct cifsTconInfo *tcon,
return rc;
}
#endif
/*
CIFS_EXPERIMENTAL
*/
#endif /*
end unused (temporarily) function
*/
/* xid, tcon, searchName and codepage are input parms, rest are returned */
int
...
...
fs/cifs/md4.c
View file @
c2b0a383
...
...
@@ -21,6 +21,8 @@
*/
#include <linux/module.h>
#include <linux/fs.h>
#include "cifsencrypt.h"
/* NOTE: This code makes no attempt to be fast! */
static
__u32
...
...
fs/cifs/smbdes.c
View file @
c2b0a383
...
...
@@ -45,6 +45,7 @@
up with a different answer to the one above)
*/
#include <linux/slab.h>
#include "cifsencrypt.h"
#define uchar unsigned char
static
uchar
perm1
[
56
]
=
{
57
,
49
,
41
,
33
,
25
,
17
,
9
,
...
...
@@ -376,7 +377,9 @@ E_old_pw_hash(unsigned char *p14, unsigned char *in, unsigned char *out)
smbhash
(
out
,
in
,
p14
,
1
);
smbhash
(
out
+
8
,
in
+
8
,
p14
+
7
,
1
);
}
#if 0
/* these routines are currently unneeded, but may be
needed later */
void
cred_hash1(unsigned char *out, unsigned char *in, unsigned char *key)
{
...
...
@@ -406,3 +409,4 @@ cred_hash3(unsigned char *out, unsigned char *in, unsigned char *key, int forw)
key2[0] = key[7];
smbhash(out + 8, in + 8, key2, forw);
}
#endif /* unneeded routines */
fs/cifs/smbencrypt.c
View file @
c2b0a383
...
...
@@ -32,6 +32,7 @@
#include "cifspdu.h"
#include "md5.h"
#include "cifs_debug.h"
#include "cifsencrypt.h"
#ifndef FALSE
#define FALSE 0
...
...
@@ -45,27 +46,12 @@
#define SSVALX(buf,pos,val) (CVAL(buf,pos)=(val)&0xFF,CVAL(buf,pos+1)=(val)>>8)
#define SSVAL(buf,pos,val) SSVALX((buf),(pos),((__u16)(val)))
/*The following definitions come from lib/md4.c */
void
mdfour
(
unsigned
char
*
out
,
unsigned
char
*
in
,
int
n
);
/*The following definitions come from libsmb/smbdes.c */
void
E_P16
(
unsigned
char
*
p14
,
unsigned
char
*
p16
);
void
E_P24
(
unsigned
char
*
p21
,
unsigned
char
*
c8
,
unsigned
char
*
p24
);
void
D_P16
(
unsigned
char
*
p14
,
unsigned
char
*
in
,
unsigned
char
*
out
);
void
E_old_pw_hash
(
unsigned
char
*
p14
,
unsigned
char
*
in
,
unsigned
char
*
out
);
void
cred_hash1
(
unsigned
char
*
out
,
unsigned
char
*
in
,
unsigned
char
*
key
);
void
cred_hash2
(
unsigned
char
*
out
,
unsigned
char
*
in
,
unsigned
char
*
key
);
void
cred_hash3
(
unsigned
char
*
out
,
unsigned
char
*
in
,
unsigned
char
*
key
,
int
forw
);
/*The following definitions come from libsmb/smbencrypt.c */
void
SMBencrypt
(
unsigned
char
*
passwd
,
unsigned
char
*
c8
,
unsigned
char
*
p24
);
void
E_md4hash
(
const
unsigned
char
*
passwd
,
unsigned
char
*
p16
);
void
nt_lm_owf_gen
(
char
*
pwd
,
unsigned
char
nt_p16
[
16
],
unsigned
char
p16
[
16
]);
void
SMBOWFencrypt
(
unsigned
char
passwd
[
16
],
unsigned
char
*
c8
,
static
void
SMBOWFencrypt
(
unsigned
char
passwd
[
16
],
unsigned
char
*
c8
,
unsigned
char
p24
[
24
]);
void
NTLMSSPOWFencrypt
(
unsigned
char
passwd
[
8
],
unsigned
char
*
ntlmchalresp
,
unsigned
char
p24
[
24
]);
...
...
@@ -223,7 +209,7 @@ ntv2_owf_gen(const unsigned char owf[16], const char *user_n,
#endif
/* Does the des encryption from the NT or LM MD4 hash. */
void
static
void
SMBOWFencrypt
(
unsigned
char
passwd
[
16
],
unsigned
char
*
c8
,
unsigned
char
p24
[
24
])
{
...
...
@@ -262,8 +248,11 @@ SMBNTencrypt(unsigned char *passwd, unsigned char *c8, unsigned char *p24)
SMBOWFencrypt
(
p21
,
c8
,
p24
);
}
/* Does the md5 encryption from the NT hash for NTLMv2. */
void
/* These routines will be needed later */
#if 0
static void
SMBOWFencrypt_ntv2(const unsigned char kr[16],
const struct data_blob * srv_chal,
const struct data_blob * cli_chal, unsigned char resp_buf[16])
...
...
@@ -276,7 +265,7 @@ SMBOWFencrypt_ntv2(const unsigned char kr[16],
hmac_md5_final(resp_buf, &ctx);
}
void
static
void
SMBsesskeygen_ntv2(const unsigned char kr[16],
const unsigned char *nt_resp, __u8 sess_key[16])
{
...
...
@@ -287,9 +276,10 @@ SMBsesskeygen_ntv2(const unsigned char kr[16],
hmac_md5_final((unsigned char *) sess_key, &ctx);
}
void
static
void
SMBsesskeygen_ntv1(const unsigned char kr[16],
const unsigned char *nt_resp, __u8 sess_key[16])
{
mdfour((unsigned char *) sess_key, (unsigned char *) kr, 16);
}
#endif
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment