send times to welist

ED25519 times signing
This commit is contained in:
2025-11-01 18:34:35 -04:00
parent ab0f132081
commit 62c4ad824b
5 changed files with 91 additions and 49 deletions

View File

@@ -24,6 +24,7 @@ use reqwest::Client as rClient;
use openssl::hash::MessageDigest;
use openssl::pkey::{PKey};
use openssl::sign::Signer;
use openssl::sign::Verifier;
use base64::{engine::general_purpose, Engine as _};
use std::fs;
@@ -327,7 +328,7 @@ async fn send_stats_report(cfg: &MyConfig, bcinfo: GetBlockchainInfoResult) -> R
}))
.send().await?;
let body = &(response.text().await?);
println!("Body: {}", body);
trace!("Body: {}", body);
}else {
debug!("Not sending stats");
}
@@ -339,16 +340,14 @@ fn sign_message(private_key_path: &str, message: &str) -> String {
let key_data = fs::read(private_key_path).unwrap();
let private_key = PKey::private_key_from_pem(&key_data).unwrap();
let mut signer = Signer::new_without_digest(&private_key).unwrap();
let mut signer = Signer::new(MessageDigest::sha256(), &private_key).unwrap();
let signature = signer.sign_oneshot_to_vec(message.as_bytes()).unwrap();
signer.update(message.as_bytes()).unwrap();
let firma = signer.sign_to_vec().unwrap();
let signature_b64 = general_purpose::STANDARD.encode(&signature);
let firma_b64 = general_purpose::STANDARD.encode(&firma);
firma_b64
signature_b64
}
fn parse_env(cfg: &mut MyConfig){