Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
MTProxy2
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
MTProxy2
Commits
e35c207e
Commit
e35c207e
authored
Jul 15, 2019
by
levlam
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Choose cipher suite for ServerHello..
parent
74095c52
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
2 deletions
+20
-2
net-tcp-rpc-ext-server.c
net/net-tcp-rpc-ext-server.c
+20
-2
No files found.
net/net-tcp-rpc-ext-server.c
View file @
e35c207e
...
@@ -1048,6 +1048,23 @@ int tcp_rpcs_compact_parse_execute (connection_job_t C) {
...
@@ -1048,6 +1048,23 @@ int tcp_rpcs_compact_parse_execute (connection_job_t C) {
RETURN_TLS_ERROR
(
info
);
RETURN_TLS_ERROR
(
info
);
}
}
int
pos
=
76
;
int
cipher_suites_length
=
read_length
(
client_hello
,
&
pos
);
if
(
pos
+
cipher_suites_length
>
read_len
)
{
vkprintf
(
1
,
"Too long cipher suites list of length %d
\n
"
,
cipher_suites_length
);
RETURN_TLS_ERROR
(
info
);
}
while
(
cipher_suites_length
>=
2
&&
(
client_hello
[
pos
]
&
0x0F
)
==
0x0A
&&
(
client_hello
[
pos
+
1
]
&
0x0F
)
==
0x0A
)
{
// skip grease
cipher_suites_length
-=
2
;
pos
+=
2
;
}
if
(
cipher_suites_length
<=
1
||
client_hello
[
pos
]
!=
0x13
||
client_hello
[
pos
+
1
]
<
0x01
||
client_hello
[
pos
+
1
]
>
0x03
)
{
vkprintf
(
1
,
"Can't find supported cipher suite
\n
"
);
RETURN_TLS_ERROR
(
info
);
}
unsigned
char
cipher_suite_id
=
client_hello
[
pos
+
1
];
assert
(
rwm_skip_data
(
&
c
->
in
,
len
)
==
len
);
assert
(
rwm_skip_data
(
&
c
->
in
,
len
)
==
len
);
c
->
flags
|=
C_IS_TLS
;
c
->
flags
|=
C_IS_TLS
;
c
->
left_tls_packet_length
=
-
1
;
c
->
left_tls_packet_length
=
-
1
;
...
@@ -1061,10 +1078,11 @@ int tcp_rpcs_compact_parse_execute (connection_job_t C) {
...
@@ -1061,10 +1078,11 @@ int tcp_rpcs_compact_parse_execute (connection_job_t C) {
memcpy
(
response_buffer
,
"
\x16\x03\x03\x00\x7a\x02\x00\x00\x76\x03\x03
"
,
11
);
memcpy
(
response_buffer
,
"
\x16\x03\x03\x00\x7a\x02\x00\x00\x76\x03\x03
"
,
11
);
memset
(
response_buffer
+
11
,
'\0'
,
32
);
memset
(
response_buffer
+
11
,
'\0'
,
32
);
response_buffer
[
43
]
=
'\x20'
;
response_buffer
[
43
]
=
'\x20'
;
memcpy
(
response_buffer
+
44
,
client_
random
,
32
);
memcpy
(
response_buffer
+
44
,
client_
hello
+
44
,
32
);
memcpy
(
response_buffer
+
76
,
"
\x13\x01\x00\x00\x2e
"
,
5
);
memcpy
(
response_buffer
+
76
,
"
\x13\x01\x00\x00\x2e
"
,
5
);
response_buffer
[
77
]
=
cipher_suite_id
;
int
pos
=
81
;
pos
=
81
;
int
tls_server_extensions
[
3
]
=
{
0x33
,
0x2b
,
-
1
};
int
tls_server_extensions
[
3
]
=
{
0x33
,
0x2b
,
-
1
};
if
(
info
->
is_reversed_extension_order
)
{
if
(
info
->
is_reversed_extension_order
)
{
int
t
=
tls_server_extensions
[
0
];
int
t
=
tls_server_extensions
[
0
];
...
...
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