plugin_framework, add peer id for plugin signature

Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
fufesou 2023-05-16 13:47:11 +08:00
parent 97e9682757
commit cc46fd59fc

View File

@ -80,6 +80,7 @@ pub(super) struct MsgToExtSupport {
#[derive(Debug, Serialize)]
struct PluginSignReq {
peer_id: String,
plugin_id: String,
version: String,
msg: Vec<u8>,
@ -282,7 +283,10 @@ fn request_plugin_sign(id: String, msg_to_rustdesk: MsgToRustDesk) -> PluginRetu
thread::spawn(move || {
let sign_url = format!("{}/lic/web/api/plugin-sign", get_api_server());
let client = reqwest::blocking::Client::new();
// to-do: Add peer id and plugin_id in the message to sign.
// So that the server can verify the ids.
let req = PluginSignReq {
peer_id: crate::ui_interface::get_id(),
plugin_id: id.clone(),
version: signature_data.version,
msg: signature_data.data,