Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
tg
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
tg
Commits
664e6e15
Commit
664e6e15
authored
Dec 23, 2013
by
Vysheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support for g!=2 in DH
parent
be596ed9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
mtproto-client.c
mtproto-client.c
+2
-2
queries.c
queries.c
+3
-3
No files found.
mtproto-client.c
View file @
664e6e15
...
@@ -441,7 +441,7 @@ int process_dh_answer (struct connection *c, char *packet, int len) {
...
@@ -441,7 +441,7 @@ int process_dh_answer (struct connection *c, char *packet, int len) {
assert
(
decrypt_buffer
[
5
]
==
(
int
)
CODE_server_DH_inner_data
);
assert
(
decrypt_buffer
[
5
]
==
(
int
)
CODE_server_DH_inner_data
);
assert
(
!
memcmp
(
decrypt_buffer
+
6
,
nonce
,
16
));
assert
(
!
memcmp
(
decrypt_buffer
+
6
,
nonce
,
16
));
assert
(
!
memcmp
(
decrypt_buffer
+
10
,
server_nonce
,
16
));
assert
(
!
memcmp
(
decrypt_buffer
+
10
,
server_nonce
,
16
));
assert
(
decrypt_buffer
[
14
]
==
2
)
;
int
g
=
decrypt_buffer
[
14
]
;
in_ptr
=
decrypt_buffer
+
15
;
in_ptr
=
decrypt_buffer
+
15
;
in_end
=
decrypt_buffer
+
(
l
>>
2
);
in_end
=
decrypt_buffer
+
(
l
>>
2
);
BN_init
(
&
dh_prime
);
BN_init
(
&
dh_prime
);
...
@@ -469,7 +469,7 @@ int process_dh_answer (struct connection *c, char *packet, int len) {
...
@@ -469,7 +469,7 @@ int process_dh_answer (struct connection *c, char *packet, int len) {
out_long
(
0LL
);
out_long
(
0LL
);
BN_init
(
&
dh_g
);
BN_init
(
&
dh_g
);
BN_set_word
(
&
dh_g
,
2
);
BN_set_word
(
&
dh_g
,
g
);
assert
(
RAND_pseudo_bytes
((
unsigned
char
*
)
s_power
,
256
)
>=
0
);
assert
(
RAND_pseudo_bytes
((
unsigned
char
*
)
s_power
,
256
)
>=
0
);
BIGNUM
*
dh_power
=
BN_new
();
BIGNUM
*
dh_power
=
BN_new
();
...
...
queries.c
View file @
664e6e15
...
@@ -302,8 +302,8 @@ extern struct dc *DC_list[];
...
@@ -302,8 +302,8 @@ extern struct dc *DC_list[];
extern
struct
dc
*
DC_working
;
extern
struct
dc
*
DC_working
;
void
out_random
(
int
n
)
{
void
out_random
(
int
n
)
{
assert
(
n
<=
16
);
assert
(
n
<=
32
);
static
char
buf
[
16
];
static
char
buf
[
32
];
int
i
;
int
i
;
for
(
i
=
0
;
i
<
n
;
i
++
)
{
for
(
i
=
0
;
i
<
n
;
i
++
)
{
buf
[
i
]
=
lrand48
()
&
255
;
buf
[
i
]
=
lrand48
()
&
255
;
...
@@ -1375,7 +1375,7 @@ void send_part (struct send_file *f) {
...
@@ -1375,7 +1375,7 @@ void send_part (struct send_file *f) {
encr_start
();
encr_start
();
out_int
(
CODE_decrypted_message
);
out_int
(
CODE_decrypted_message
);
out_long
(
r
);
out_long
(
r
);
out_random
(
1
6
);
out_random
(
1
5
+
4
*
(
lrand48
()
%
3
)
);
out_string
(
""
);
out_string
(
""
);
if
(
f
->
media_type
==
CODE_input_media_uploaded_photo
)
{
if
(
f
->
media_type
==
CODE_input_media_uploaded_photo
)
{
out_int
(
CODE_decrypted_message_media_photo
);
out_int
(
CODE_decrypted_message_media_photo
);
...
...
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