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
d0f9832b
Commit
d0f9832b
authored
Nov 06, 2013
by
vysheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed bug in restarting in starting encrypted chat
parent
382e8d75
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
1 deletion
+18
-1
loop.c
loop.c
+18
-1
No files found.
loop.c
View file @
d0f9832b
...
...
@@ -284,6 +284,10 @@ void write_state_file (void) {
extern
peer_t
*
Peers
[];
extern
int
peer_num
;
extern
int
encr_root
;
extern
unsigned
char
*
encr_prime
;
extern
int
encr_param_version
;
void
read_secret_chat_file
(
void
)
{
int
fd
=
open
(
get_secret_chat_filename
(),
O_CREAT
|
O_RDWR
,
0600
);
if
(
fd
<
0
)
{
...
...
@@ -329,6 +333,14 @@ void read_secret_chat_file (void) {
assert
(
read
(
fd
,
&
E
->
key_fingerprint
,
8
)
==
8
);
insert_encrypted_chat
(
P
);
}
if
(
version
>=
1
)
{
assert
(
read
(
fd
,
&
encr_root
,
4
)
==
4
);
if
(
encr_root
)
{
assert
(
read
(
fd
,
&
encr_param_version
,
4
)
==
4
);
encr_prime
=
malloc
(
256
);
assert
(
read
(
fd
,
encr_prime
,
256
)
==
256
);
}
}
close
(
fd
);
}
...
...
@@ -339,7 +351,7 @@ void write_secret_chat_file (void) {
}
int
x
[
2
];
x
[
0
]
=
SECRET_CHAT_FILE_MAGIC
;
x
[
1
]
=
0
;
x
[
1
]
=
1
;
assert
(
write
(
fd
,
x
,
8
)
==
8
);
int
i
;
int
cc
=
0
;
...
...
@@ -375,6 +387,11 @@ void write_secret_chat_file (void) {
assert
(
write
(
fd
,
&
Peers
[
i
]
->
encr_chat
.
key_fingerprint
,
8
)
==
8
);
}
}
assert
(
write
(
fd
,
&
encr_root
,
4
)
==
4
);
if
(
encr_root
)
{
assert
(
write
(
fd
,
&
encr_param_version
,
4
)
==
4
);
assert
(
write
(
fd
,
encr_prime
,
256
)
==
256
);
}
close
(
fd
);
}
...
...
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