mirror of
https://github.com/chatmail/core.git
synced 2026-05-09 01:46:30 +03:00
fix(securejoin): improve locking further
This commit is contained in:
@@ -498,11 +498,14 @@ pub unsafe fn dc_handle_securejoin_handshake(
|
|||||||
b"vc-auth-required\x00" as *const u8 as *const libc::c_char,
|
b"vc-auth-required\x00" as *const u8 as *const libc::c_char,
|
||||||
) == 0i32
|
) == 0i32
|
||||||
{
|
{
|
||||||
|
let cond = {
|
||||||
let bob_a = context.bob.clone();
|
let bob_a = context.bob.clone();
|
||||||
let bob = bob_a.read().unwrap();
|
let bob = bob_a.read().unwrap();
|
||||||
let scan = bob.qr_scan;
|
let scan = bob.qr_scan;
|
||||||
if scan.is_null() || bob.expects != 2i32 || 0 != join_vg && (*scan).state != 202i32
|
scan.is_null() || bob.expects != 2 || 0 != join_vg && (*scan).state != 202
|
||||||
{
|
};
|
||||||
|
|
||||||
|
if cond {
|
||||||
dc_log_warning(
|
dc_log_warning(
|
||||||
context,
|
context,
|
||||||
0i32,
|
0i32,
|
||||||
@@ -512,11 +515,14 @@ pub unsafe fn dc_handle_securejoin_handshake(
|
|||||||
// no error, just aborted somehow or a mail from another handshake
|
// no error, just aborted somehow or a mail from another handshake
|
||||||
current_block = 4378276786830486580;
|
current_block = 4378276786830486580;
|
||||||
} else {
|
} else {
|
||||||
|
{
|
||||||
|
let scan = context.bob.clone().read().unwrap().qr_scan;
|
||||||
scanned_fingerprint_of_alice = dc_strdup((*scan).fingerprint);
|
scanned_fingerprint_of_alice = dc_strdup((*scan).fingerprint);
|
||||||
auth = dc_strdup((*scan).auth);
|
auth = dc_strdup((*scan).auth);
|
||||||
if 0 != join_vg {
|
if 0 != join_vg {
|
||||||
grpid = dc_strdup((*scan).text2)
|
grpid = dc_strdup((*scan).text2)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if 0 == encrypted_and_signed(mimeparser, scanned_fingerprint_of_alice) {
|
if 0 == encrypted_and_signed(mimeparser, scanned_fingerprint_of_alice) {
|
||||||
could_not_establish_secure_connection(
|
could_not_establish_secure_connection(
|
||||||
context,
|
context,
|
||||||
@@ -738,8 +744,11 @@ pub unsafe fn dc_handle_securejoin_handshake(
|
|||||||
);
|
);
|
||||||
current_block = 4378276786830486580;
|
current_block = 4378276786830486580;
|
||||||
} else {
|
} else {
|
||||||
|
let cond = {
|
||||||
let scan = context.bob.clone().read().unwrap().qr_scan;
|
let scan = context.bob.clone().read().unwrap().qr_scan;
|
||||||
if scan.is_null() || 0 != join_vg && (*scan).state != 202i32 {
|
scan.is_null() || 0 != join_vg && (*scan).state != 202
|
||||||
|
};
|
||||||
|
if cond {
|
||||||
dc_log_warning(
|
dc_log_warning(
|
||||||
context,
|
context,
|
||||||
0i32,
|
0i32,
|
||||||
@@ -748,10 +757,13 @@ pub unsafe fn dc_handle_securejoin_handshake(
|
|||||||
);
|
);
|
||||||
current_block = 4378276786830486580;
|
current_block = 4378276786830486580;
|
||||||
} else {
|
} else {
|
||||||
|
{
|
||||||
|
let scan = context.bob.clone().read().unwrap().qr_scan;
|
||||||
scanned_fingerprint_of_alice = dc_strdup((*scan).fingerprint);
|
scanned_fingerprint_of_alice = dc_strdup((*scan).fingerprint);
|
||||||
if 0 != join_vg {
|
if 0 != join_vg {
|
||||||
grpid = dc_strdup((*scan).text2)
|
grpid = dc_strdup((*scan).text2)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
let mut vg_expect_encrypted: libc::c_int = 1i32;
|
let mut vg_expect_encrypted: libc::c_int = 1i32;
|
||||||
if 0 != join_vg {
|
if 0 != join_vg {
|
||||||
let mut is_verified_group: libc::c_int = 0i32;
|
let mut is_verified_group: libc::c_int = 0i32;
|
||||||
|
|||||||
Reference in New Issue
Block a user