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
2ddd7a1d
Commit
2ddd7a1d
authored
Dec 23, 2013
by
Vysheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed check g_a in encr chats
parent
efc7673a
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
0 deletions
+7
-0
binlog.c
binlog.c
+2
-0
mtproto-client.h
mtproto-client.h
+3
-0
queries.c
queries.c
+2
-0
No files found.
binlog.c
View file @
2ddd7a1d
...
...
@@ -26,6 +26,7 @@
#include <stdio.h>
#include <string.h>
#include <assert.h>
#include <openssl/bn.h>
#include "binlog.h"
#include "mtproto-common.h"
...
...
@@ -525,6 +526,7 @@ void replay_log_event (void) {
memcpy
(
encr_prime
,
rptr
,
256
);
rptr
+=
64
;
encr_param_version
=
*
(
rptr
++
);
}
break
;
case
CODE_binlog_encr_chat_init
:
...
...
mtproto-client.h
View file @
2ddd7a1d
...
...
@@ -20,9 +20,12 @@
#ifndef __MTPROTO_CLIENT_H__
#define __MTPROTO_CLIENT_H__
#include "net.h"
#include <openssl/bn.h>
void
on_start
(
void
);
long
long
encrypt_send_message
(
struct
connection
*
c
,
int
*
msg
,
int
msg_ints
,
int
useful
);
void
dc_authorize
(
struct
dc
*
DC
);
void
work_update
(
struct
connection
*
c
,
long
long
msg_id
);
void
work_update_binlog
(
void
);
int
check_g
(
BIGNUM
*
g
);
int
check_DH_params
(
BIGNUM
*
p
,
int
g
);
#endif
queries.c
View file @
2ddd7a1d
...
...
@@ -2270,6 +2270,7 @@ void do_send_accept_encr_chat (struct secret_chat *E, unsigned char *random) {
assert
(
b
);
BIGNUM
*
g_a
=
BN_bin2bn
(
E
->
g_key
,
256
,
0
);
assert
(
g_a
);
assert
(
check_g
(
g_a
)
>=
0
);
if
(
!
ctx
)
{
ctx
=
BN_CTX_new
();
BN_CTX_init
(
ctx
);
...
...
@@ -2315,6 +2316,7 @@ void do_create_keys_end (struct secret_chat *U) {
assert
(
encr_prime
);
BIGNUM
*
g_b
=
BN_bin2bn
(
U
->
g_key
,
256
,
0
);
assert
(
g_b
);
assert
(
check_g
(
g_b
)
>=
0
);
if
(
!
ctx
)
{
ctx
=
BN_CTX_new
();
BN_CTX_init
(
ctx
);
...
...
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