mirror of
https://github.com/chatmail/core.git
synced 2026-05-13 03:46:32 +03:00
rename dc_securejoin to securejoin.rs
This commit is contained in:
@@ -1324,7 +1324,7 @@ pub unsafe extern "C" fn dc_get_securejoin_qr(
|
|||||||
}
|
}
|
||||||
|
|
||||||
let context = &*context;
|
let context = &*context;
|
||||||
dc_securejoin::dc_get_securejoin_qr(context, chat_id)
|
securejoin::dc_get_securejoin_qr(context, chat_id)
|
||||||
.unwrap_or("".to_string())
|
.unwrap_or("".to_string())
|
||||||
.strdup()
|
.strdup()
|
||||||
}
|
}
|
||||||
@@ -1341,7 +1341,7 @@ pub unsafe extern "C" fn dc_join_securejoin(
|
|||||||
|
|
||||||
let context = &*context;
|
let context = &*context;
|
||||||
|
|
||||||
dc_securejoin::dc_join_securejoin(context, as_str(qr))
|
securejoin::dc_join_securejoin(context, as_str(qr))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
|
|||||||
@@ -24,10 +24,10 @@ use deltachat::config;
|
|||||||
use deltachat::configure::*;
|
use deltachat::configure::*;
|
||||||
use deltachat::constants::*;
|
use deltachat::constants::*;
|
||||||
use deltachat::context::*;
|
use deltachat::context::*;
|
||||||
use deltachat::dc_securejoin::*;
|
|
||||||
use deltachat::dc_tools::*;
|
use deltachat::dc_tools::*;
|
||||||
use deltachat::job::*;
|
use deltachat::job::*;
|
||||||
use deltachat::oauth2::*;
|
use deltachat::oauth2::*;
|
||||||
|
use deltachat::securejoin::*;
|
||||||
use deltachat::types::*;
|
use deltachat::types::*;
|
||||||
use deltachat::x::*;
|
use deltachat::x::*;
|
||||||
use rustyline::completion::{Completer, FilenameCompleter, Pair};
|
use rustyline::completion::{Completer, FilenameCompleter, Pair};
|
||||||
|
|||||||
@@ -15,7 +15,6 @@ use crate::constants::*;
|
|||||||
use crate::contact::*;
|
use crate::contact::*;
|
||||||
use crate::context::{do_heuristics_moves, Context};
|
use crate::context::{do_heuristics_moves, Context};
|
||||||
use crate::dc_mimeparser::*;
|
use crate::dc_mimeparser::*;
|
||||||
use crate::dc_securejoin::*;
|
|
||||||
use crate::dc_strencode::*;
|
use crate::dc_strencode::*;
|
||||||
use crate::dc_tools::*;
|
use crate::dc_tools::*;
|
||||||
use crate::error::Result;
|
use crate::error::Result;
|
||||||
@@ -24,6 +23,7 @@ use crate::location;
|
|||||||
use crate::message::*;
|
use crate::message::*;
|
||||||
use crate::param::*;
|
use crate::param::*;
|
||||||
use crate::peerstate::*;
|
use crate::peerstate::*;
|
||||||
|
use crate::securejoin::handle_securejoin_handshake;
|
||||||
use crate::sql;
|
use crate::sql;
|
||||||
use crate::stock::StockMessage;
|
use crate::stock::StockMessage;
|
||||||
use crate::types::*;
|
use crate::types::*;
|
||||||
@@ -400,7 +400,7 @@ unsafe fn add_parts(
|
|||||||
msgrmsg = 1;
|
msgrmsg = 1;
|
||||||
*chat_id = 0;
|
*chat_id = 0;
|
||||||
allow_creation = 1;
|
allow_creation = 1;
|
||||||
let handshake = dc_handle_securejoin_handshake(context, mime_parser, *from_id);
|
let handshake = handle_securejoin_handshake(context, mime_parser, *from_id);
|
||||||
if 0 != handshake & DC_HANDSHAKE_STOP_NORMAL_PROCESSING {
|
if 0 != handshake & DC_HANDSHAKE_STOP_NORMAL_PROCESSING {
|
||||||
*hidden = 1;
|
*hidden = 1;
|
||||||
*add_delete_job = handshake & DC_HANDSHAKE_ADD_DELETE_JOB;
|
*add_delete_job = handshake & DC_HANDSHAKE_ADD_DELETE_JOB;
|
||||||
|
|||||||
@@ -23,13 +23,13 @@ use crate::aheader::*;
|
|||||||
use crate::config::Config;
|
use crate::config::Config;
|
||||||
use crate::context::Context;
|
use crate::context::Context;
|
||||||
use crate::dc_mimeparser::*;
|
use crate::dc_mimeparser::*;
|
||||||
use crate::dc_securejoin::*;
|
|
||||||
use crate::dc_tools::*;
|
use crate::dc_tools::*;
|
||||||
use crate::error::*;
|
use crate::error::*;
|
||||||
use crate::key::*;
|
use crate::key::*;
|
||||||
use crate::keyring::*;
|
use crate::keyring::*;
|
||||||
use crate::peerstate::*;
|
use crate::peerstate::*;
|
||||||
use crate::pgp::*;
|
use crate::pgp::*;
|
||||||
|
use crate::securejoin::handle_degrade_event;
|
||||||
use crate::types::*;
|
use crate::types::*;
|
||||||
use crate::x::*;
|
use crate::x::*;
|
||||||
|
|
||||||
@@ -440,7 +440,7 @@ impl E2eeHelper {
|
|||||||
}
|
}
|
||||||
if let Some(ref peerstate) = peerstate {
|
if let Some(ref peerstate) = peerstate {
|
||||||
if peerstate.degrade_event.is_some() {
|
if peerstate.degrade_event.is_some() {
|
||||||
dc_handle_degrade_event(context, &peerstate);
|
handle_degrade_event(context, &peerstate);
|
||||||
}
|
}
|
||||||
if let Some(ref key) = peerstate.gossip_key {
|
if let Some(ref key) = peerstate.gossip_key {
|
||||||
public_keyring_for_validate.add_ref(key);
|
public_keyring_for_validate.add_ref(key);
|
||||||
@@ -681,7 +681,7 @@ unsafe fn update_gossip_peerstates(
|
|||||||
}
|
}
|
||||||
if let Some(peerstate) = peerstate {
|
if let Some(peerstate) = peerstate {
|
||||||
if peerstate.degrade_event.is_some() {
|
if peerstate.degrade_event.is_some() {
|
||||||
dc_handle_degrade_event(context, &peerstate);
|
handle_degrade_event(context, &peerstate);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -57,11 +57,11 @@ mod dc_loginparam;
|
|||||||
mod dc_mimefactory;
|
mod dc_mimefactory;
|
||||||
pub mod dc_mimeparser;
|
pub mod dc_mimeparser;
|
||||||
pub mod dc_receive_imf;
|
pub mod dc_receive_imf;
|
||||||
pub mod dc_securejoin;
|
|
||||||
mod dc_simplify;
|
mod dc_simplify;
|
||||||
mod dc_strencode;
|
mod dc_strencode;
|
||||||
mod dc_token;
|
mod dc_token;
|
||||||
pub mod dc_tools;
|
pub mod dc_tools;
|
||||||
|
pub mod securejoin;
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod test_utils;
|
mod test_utils;
|
||||||
|
|||||||
@@ -341,7 +341,7 @@ fn fingerprint_equals_sender(
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* library private: secure-join */
|
/* library private: secure-join */
|
||||||
pub fn dc_handle_securejoin_handshake(
|
pub fn handle_securejoin_handshake(
|
||||||
context: &Context,
|
context: &Context,
|
||||||
mimeparser: &dc_mimeparser_t,
|
mimeparser: &dc_mimeparser_t,
|
||||||
contact_id: uint32_t,
|
contact_id: uint32_t,
|
||||||
@@ -748,7 +748,7 @@ fn encrypted_and_signed(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn dc_handle_degrade_event(context: &Context, peerstate: &Peerstate) {
|
pub fn handle_degrade_event(context: &Context, peerstate: &Peerstate) {
|
||||||
// - we do not issue an warning for DC_DE_ENCRYPTION_PAUSED as this is quite normal
|
// - we do not issue an warning for DC_DE_ENCRYPTION_PAUSED as this is quite normal
|
||||||
// - currently, we do not issue an extra warning for DC_DE_VERIFICATION_LOST - this always comes
|
// - currently, we do not issue an extra warning for DC_DE_VERIFICATION_LOST - this always comes
|
||||||
// together with DC_DE_FINGERPRINT_CHANGED which is logged, the idea is not to bother
|
// together with DC_DE_FINGERPRINT_CHANGED which is logged, the idea is not to bother
|
||||||
Reference in New Issue
Block a user