From 3cba56c809b56ca395832e17fea2f0e936cae100 Mon Sep 17 00:00:00 2001 From: rustdesk Date: Sun, 20 Mar 2022 21:30:04 +0800 Subject: [PATCH] fix id_pk --- src/client.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/client.rs b/src/client.rs index d0790e14c..71d4d7f08 100644 --- a/src/client.rs +++ b/src/client.rs @@ -327,9 +327,11 @@ impl Client { let rs_pk = get_rs_pk("OeVuKk5nlHiXp+APNn0Y3pC1Iwpwn44JGqrQCsWqmBw="); let mut sign_pk = None; if !signed_id_pk.is_empty() && rs_pk.is_some() { - if let Ok(v) = serde_json::from_slice::(&signed_id_pk) { - if v.id == peer_id { - sign_pk = Some(sign::PublicKey(v.pk)); + if let Ok(data) = sign::verify(&signed_id_pk, &rs_pk.unwrap()) { + if let Ok(v) = serde_json::from_slice::(&data) { + if v.id == peer_id { + sign_pk = Some(sign::PublicKey(v.pk)); + } } } if sign_pk.is_none() {