fix constant panics when keystore is weird (pt2)
This commit is contained in:
parent
afbd1d2ba0
commit
b60c7a5bb0
|
@ -91,15 +91,18 @@ pub async fn dnclient(
|
||||||
};
|
};
|
||||||
|
|
||||||
let mut valid = false;
|
let mut valid = false;
|
||||||
|
let mut valid_key;
|
||||||
|
|
||||||
if let Some(client_keys) = client_keys {
|
if let Some(client_keys) = client_keys {
|
||||||
if client_keys.ed_pub.verify(req.message.as_bytes(), &signature).is_ok() {
|
if client_keys.ed_pub.verify(req.message.as_bytes(), &signature).is_ok() {
|
||||||
valid = true;
|
valid = true;
|
||||||
|
valid_key = client_keys;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if let Some(client_keys_2) = client_keys_2 {
|
if let Some(client_keys_2) = client_keys_2 {
|
||||||
if client_keys_2.ed_pub.verify(req.message.as_bytes(), &signature).is_ok() {
|
if client_keys_2.ed_pub.verify(req.message.as_bytes(), &signature).is_ok() {
|
||||||
valid = true;
|
valid = true;
|
||||||
|
valid_key = client_keys_2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -114,6 +117,8 @@ pub async fn dnclient(
|
||||||
}]);
|
}]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let client_keys = valid_key;
|
||||||
|
|
||||||
// Sig OK
|
// Sig OK
|
||||||
// Decode the message from base64
|
// Decode the message from base64
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue