Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
etercifs
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
etercifs
Commits
9dc48a94
Commit
9dc48a94
authored
Jul 02, 2016
by
Pavel Shilovsky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update 3.4 sources from stable (v3.4.112)
parent
c18a6659
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
3 deletions
+52
-3
cifsencrypt.c
sources/3.4/cifsencrypt.c
+50
-1
cifsfs.c
sources/3.4/cifsfs.c
+2
-2
No files found.
sources/3.4/cifsencrypt.c
View file @
9dc48a94
...
...
@@ -388,6 +388,48 @@ find_domain_name(struct cifs_ses *ses, const struct nls_table *nls_cp)
return
0
;
}
/* Server has provided av pairs/target info in the type 2 challenge
* packet and we have plucked it and stored within smb session.
* We parse that blob here to find the server given timestamp
* as part of ntlmv2 authentication (or local current time as
* default in case of failure)
*/
static
__le64
find_timestamp
(
struct
cifs_ses
*
ses
)
{
unsigned
int
attrsize
;
unsigned
int
type
;
unsigned
int
onesize
=
sizeof
(
struct
ntlmssp2_name
);
unsigned
char
*
blobptr
;
unsigned
char
*
blobend
;
struct
ntlmssp2_name
*
attrptr
;
if
(
!
ses
->
auth_key
.
len
||
!
ses
->
auth_key
.
response
)
return
0
;
blobptr
=
ses
->
auth_key
.
response
;
blobend
=
blobptr
+
ses
->
auth_key
.
len
;
while
(
blobptr
+
onesize
<
blobend
)
{
attrptr
=
(
struct
ntlmssp2_name
*
)
blobptr
;
type
=
le16_to_cpu
(
attrptr
->
type
);
if
(
type
==
NTLMSSP_AV_EOL
)
break
;
blobptr
+=
2
;
/* advance attr type */
attrsize
=
le16_to_cpu
(
attrptr
->
length
);
blobptr
+=
2
;
/* advance attr size */
if
(
blobptr
+
attrsize
>
blobend
)
break
;
if
(
type
==
NTLMSSP_AV_TIMESTAMP
)
{
if
(
attrsize
==
sizeof
(
u64
))
return
*
((
__le64
*
)
blobptr
);
}
blobptr
+=
attrsize
;
/* advance attr value */
}
return
cpu_to_le64
(
cifs_UnixTimeToNT
(
CURRENT_TIME
));
}
static
int
calc_ntlmv2_hash
(
struct
cifs_ses
*
ses
,
char
*
ntlmv2_hash
,
const
struct
nls_table
*
nls_cp
)
{
...
...
@@ -549,6 +591,7 @@ setup_ntlmv2_rsp(struct cifs_ses *ses, const struct nls_table *nls_cp)
struct
ntlmv2_resp
*
buf
;
char
ntlmv2_hash
[
16
];
unsigned
char
*
tiblob
=
NULL
;
/* target info blob */
__le64
rsp_timestamp
;
if
(
ses
->
server
->
secType
==
RawNTLMSSP
)
{
if
(
!
ses
->
domainName
)
{
...
...
@@ -566,6 +609,12 @@ setup_ntlmv2_rsp(struct cifs_ses *ses, const struct nls_table *nls_cp)
}
}
/* Must be within 5 minutes of the server (or in range +/-2h
* in case of Mac OS X), so simply carry over server timestamp
* (as Windows 7 does)
*/
rsp_timestamp
=
find_timestamp
(
ses
);
baselen
=
CIFS_SESS_KEY_SIZE
+
sizeof
(
struct
ntlmv2_resp
);
tilen
=
ses
->
auth_key
.
len
;
tiblob
=
ses
->
auth_key
.
response
;
...
...
@@ -583,7 +632,7 @@ setup_ntlmv2_rsp(struct cifs_ses *ses, const struct nls_table *nls_cp)
(
ses
->
auth_key
.
response
+
CIFS_SESS_KEY_SIZE
);
buf
->
blob_signature
=
cpu_to_le32
(
0x00000101
);
buf
->
reserved
=
0
;
buf
->
time
=
cpu_to_le64
(
cifs_UnixTimeToNT
(
CURRENT_TIME
))
;
buf
->
time
=
rsp_timestamp
;
get_random_bytes
(
&
buf
->
client_chal
,
sizeof
(
buf
->
client_chal
));
buf
->
reserved2
=
0
;
...
...
sources/3.4/cifsfs.c
View file @
9dc48a94
...
...
@@ -373,10 +373,10 @@ cifs_show_options(struct seq_file *s, struct dentry *root)
if
(
cifs_sb
->
mnt_cifs_flags
&
CIFS_MOUNT_MULTIUSER
)
seq_printf
(
s
,
",multiuser"
);
else
if
(
tcon
->
ses
->
user_name
)
seq_
printf
(
s
,
",username=%s
"
,
tcon
->
ses
->
user_name
);
seq_
show_option
(
s
,
"username
"
,
tcon
->
ses
->
user_name
);
if
(
tcon
->
ses
->
domainName
)
seq_
printf
(
s
,
",domain=%s
"
,
tcon
->
ses
->
domainName
);
seq_
show_option
(
s
,
"domain
"
,
tcon
->
ses
->
domainName
);
if
(
srcaddr
->
sa_family
!=
AF_UNSPEC
)
{
struct
sockaddr_in
*
saddr4
;
...
...
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