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
e0c65ac6
Commit
e0c65ac6
authored
Jan 27, 2014
by
vysheng
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of github.com:vysheng/tg
parents
408c51e5
eb54c5f0
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
5 deletions
+9
-5
README.md
README.md
+1
-1
mtproto-common.c
mtproto-common.c
+2
-0
queries.c
queries.c
+5
-4
structures.c
structures.c
+1
-0
No files found.
README.md
View file @
e0c65ac6
...
...
@@ -25,7 +25,7 @@ Install libs: readline openssl and (if you want to use config) libconfig and lub
If you do not want to use them pass options --disable-libconfig and --disable-liblua respectively
On ubuntu use:
$ sudo apt-get install libreadline-dev libconfig-dev libssl-dev lua5.2 l
u
blua5.2-dev
$ sudo apt-get install libreadline-dev libconfig-dev libssl-dev lua5.2 l
i
blua5.2-dev
On gentoo:
$ sudo emerge -av sys-libs/readline dev-libs/libconfig dev-libs/openssl dev-lang/lua
...
...
mtproto-common.c
View file @
e0c65ac6
...
...
@@ -347,6 +347,7 @@ void init_aes_unauth (const char server_nonce[16], const char hidden_client_nonc
}
else
{
AES_set_decrypt_key
(
aes_key_raw
,
32
*
8
,
&
aes_key
);
}
memset
(
aes_key_raw
,
0
,
sizeof
(
aes_key_raw
));
}
void
init_aes_auth
(
char
auth_key
[
192
],
char
msg_key
[
16
],
int
encrypt
)
{
...
...
@@ -386,6 +387,7 @@ void init_aes_auth (char auth_key[192], char msg_key[16], int encrypt) {
}
else
{
AES_set_decrypt_key
(
aes_key_raw
,
32
*
8
,
&
aes_key
);
}
memset
(
aes_key_raw
,
0
,
sizeof
(
aes_key_raw
));
}
int
pad_aes_encrypt
(
char
*
from
,
int
from_len
,
char
*
to
,
int
size
)
{
...
...
queries.c
View file @
e0c65ac6
...
...
@@ -746,6 +746,7 @@ char *encrypt_decrypted_message (struct secret_chat *E) {
AES_KEY
aes_key
;
AES_set_encrypt_key
(
key
,
256
,
&
aes_key
);
AES_ige_encrypt
((
void
*
)
encr_ptr
,
(
void
*
)
encr_ptr
,
4
*
(
encr_end
-
encr_ptr
),
&
aes_key
,
iv
,
1
);
memset
(
&
aes_key
,
0
,
sizeof
(
aes_key
));
return
(
void
*
)
msg_key
;
}
...
...
@@ -1290,15 +1291,14 @@ void send_part (struct send_file *f) {
if
(
f
->
encr
)
{
if
(
x
&
15
)
{
assert
(
f
->
offset
==
f
->
size
);
if
(
x
&
15
)
{
secure_random
(
buf
+
x
,
(
-
x
)
&
15
);
x
=
(
x
+
15
)
&
~
15
;
}
secure_random
(
buf
+
x
,
(
-
x
)
&
15
);
x
=
(
x
+
15
)
&
~
15
;
}
AES_KEY
aes_key
;
AES_set_encrypt_key
(
f
->
key
,
256
,
&
aes_key
);
AES_ige_encrypt
((
void
*
)
buf
,
(
void
*
)
buf
,
x
,
&
aes_key
,
f
->
iv
,
1
);
memset
(
&
aes_key
,
0
,
sizeof
(
aes_key
));
}
out_cstring
(
buf
,
x
);
if
(
verbosity
>=
2
)
{
...
...
@@ -1803,6 +1803,7 @@ int download_on_answer (struct query *q) {
AES_KEY
aes_key
;
AES_set_decrypt_key
(
D
->
key
,
256
,
&
aes_key
);
AES_ige_encrypt
(
ptr
,
ptr
,
len
,
&
aes_key
,
D
->
iv
,
0
);
memset
(
&
aes_key
,
0
,
sizeof
(
aes_key
));
if
(
len
>
D
->
size
-
D
->
offset
)
{
len
=
D
->
size
-
D
->
offset
;
}
...
...
structures.c
View file @
e0c65ac6
...
...
@@ -1376,6 +1376,7 @@ int decrypt_encrypted_message (struct secret_chat *E) {
AES_KEY
aes_key
;
AES_set_decrypt_key
(
key
,
256
,
&
aes_key
);
AES_ige_encrypt
((
void
*
)
decr_ptr
,
(
void
*
)
decr_ptr
,
4
*
(
decr_end
-
decr_ptr
),
&
aes_key
,
iv
,
0
);
memset
(
&
aes_key
,
0
,
sizeof
(
aes_key
));
int
x
=
*
(
decr_ptr
);
if
(
x
<
0
||
(
x
&
3
))
{
...
...
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