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
f353054c
Commit
f353054c
authored
Mar 17, 2014
by
vysheng
Browse files
Options
Browse Files
Download
Plain Diff
Merge github.com:vysheng/tg
parents
adedad0d
046b8f7a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
3 deletions
+8
-3
mtproto-client.c
mtproto-client.c
+8
-3
tg-server.pub
tg-server.pub
+0
-0
No files found.
mtproto-client.c
View file @
f353054c
...
...
@@ -131,7 +131,8 @@ int Response_len;
*
*/
char
*
rsa_public_key_name
;
// = "tg.pub";
#define TG_SERVER_PUBKEY_FILENAME "tg.pub"
char
*
rsa_public_key_name
;
// = TG_SERVER_PUBKEY_FILENAME;
RSA
*
pubKey
;
long
long
pk_fingerprint
;
...
...
@@ -1824,8 +1825,11 @@ int auth_is_success (void) {
return
auth_success
;
}
#define RANDSEED_PASSWORD_FILENAME NULL
#define RANDSEED_PASSWORD_LENGTH 0
void
on_start
(
void
)
{
prng_seed
(
0
,
0
);
prng_seed
(
RANDSEED_PASSWORD_FILENAME
,
RANDSEED_PASSWORD_LENGTH
);
if
(
rsa_public_key_name
)
{
if
(
rsa_load_public_key
(
rsa_public_key_name
)
<
0
)
{
...
...
@@ -1833,7 +1837,8 @@ void on_start (void) {
exit
(
1
);
}
}
else
{
if
(
rsa_load_public_key
(
"tg.pub"
)
<
0
&&
rsa_load_public_key
(
"/etc/"
PROG_NAME
"/server.pub"
)
<
0
)
{
if
(
rsa_load_public_key
(
TG_SERVER_PUBKEY_FILENAME
)
<
0
&&
rsa_load_public_key
(
"/etc/"
PROG_NAME
"/server.pub"
)
<
0
)
{
perror
(
"rsa_load_public_key"
);
exit
(
1
);
}
...
...
tg.pub
→
tg
-server
.pub
View file @
f353054c
File moved
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