Refactored crypto

This commit is contained in:
2026-08-26 11:52:39 +02:00
parent 756018020e
commit f94ceea2e3
5 changed files with 14 additions and 14 deletions
+4 -4
View File
@@ -66,7 +66,7 @@ impl UserConnections {
return Err(anyhow::anyhow!("Client's hostname wasn't correct"));
}
let Ok(public_key) = crate::signature::from_string(&public_key_string) else {
let Ok(public_key) = crate::crypto::from_string(&public_key_string) else {
send_socket(
&mut socket,
&ClientMethod::Error {
@@ -81,7 +81,7 @@ impl UserConnections {
if public_key
.verify_strict(
format!("{timestamp}@{hostname}").as_bytes(),
&crate::signature::from_string_sig(&signature)?,
&crate::crypto::from_string_sig(&signature)?,
)
.is_err()
{
@@ -100,8 +100,8 @@ impl UserConnections {
send_socket(
&mut socket,
&ClientMethod::Initialized {
public_key: crate::signature::to_string(&server.key.verifying_key()),
signature: crate::signature::to_string_sig(&server.key.sign(
public_key: crate::crypto::to_string(&server.key.verifying_key()),
signature: crate::crypto::to_string_sig(&server.key.sign(
format!("{server_timestamp}@{hostname}@{public_key_string}").as_bytes(),
)),