fix id_pk

This commit is contained in:
rustdesk 2022-03-20 21:30:04 +08:00
parent 1e0a347893
commit 3cba56c809

View File

@ -327,11 +327,13 @@ 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::<IdPk>(&signed_id_pk) {
if let Ok(data) = sign::verify(&signed_id_pk, &rs_pk.unwrap()) {
if let Ok(v) = serde_json::from_slice::<IdPk>(&data) {
if v.id == peer_id {
sign_pk = Some(sign::PublicKey(v.pk));
}
}
}
if sign_pk.is_none() {
log::error!("Handshake failed: invalid public key from rendezvous server");
}