Fix sig
This commit is contained in:
@@ -101,10 +101,9 @@ impl UserConnections {
|
||||
&mut socket,
|
||||
&ClientMethod::Initialized {
|
||||
public_key: crate::signature::to_string(&server.key.verifying_key()),
|
||||
signature: server
|
||||
.key
|
||||
.sign(format!("{timestamp}@{hostname}@{public_key_string}").as_bytes())
|
||||
.to_string(),
|
||||
signature: crate::signature::to_string_sig(&server.key.sign(
|
||||
format!("{server_timestamp}@{hostname}@{public_key_string}").as_bytes(),
|
||||
)),
|
||||
|
||||
timestamp: server_timestamp,
|
||||
hostname,
|
||||
|
||||
@@ -41,3 +41,7 @@ pub fn from_string_sig(signature: &str) -> anyhow::Result<Signature> {
|
||||
.map_err(|_| anyhow::anyhow!("Invalid public key"))?,
|
||||
))
|
||||
}
|
||||
|
||||
pub fn to_string_sig(signature: &Signature) -> String {
|
||||
bs58::encode(signature.to_bytes()).into_string()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user