diff --git a/trifid-api/src/routes/v1/dnclient.rs b/trifid-api/src/routes/v1/dnclient.rs index ac573fa..8f2efaa 100644 --- a/trifid-api/src/routes/v1/dnclient.rs +++ b/trifid-api/src/routes/v1/dnclient.rs @@ -91,15 +91,18 @@ pub async fn dnclient( }; let mut valid = false; + let mut valid_key; if let Some(client_keys) = client_keys { if client_keys.ed_pub.verify(req.message.as_bytes(), &signature).is_ok() { valid = true; + valid_key = client_keys; } } if let Some(client_keys_2) = client_keys_2 { if client_keys_2.ed_pub.verify(req.message.as_bytes(), &signature).is_ok() { valid = true; + valid_key = client_keys_2; } } @@ -114,6 +117,8 @@ pub async fn dnclient( }]); } + let client_keys = valid_key; + // Sig OK // Decode the message from base64