huskies: merge 925

This commit is contained in:
dave
2026-05-12 18:28:42 +00:00
parent 7660a460a5
commit f9f16d6a14
10 changed files with 187 additions and 344 deletions
+4 -3
View File
@@ -65,7 +65,7 @@ pub type SignatureHex = String;
/// which must respond with a valid signature from its node keypair.
pub fn generate_challenge() -> ChallengeHex {
let mut bytes = [0u8; 32];
rand::thread_rng().fill_bytes(&mut bytes);
rand::rng().fill_bytes(&mut bytes);
hex_encode(&bytes)
}
@@ -184,8 +184,9 @@ pub fn load_or_create_keypair_file(path: &std::path::Path) -> std::io::Result<No
SigningKey::from_bytes(&seed)
} else {
// Generate a fresh keypair and persist the seed.
let sk = SigningKey::generate(&mut rand::rngs::OsRng);
let seed = sk.to_bytes();
let mut seed = [0u8; 32];
rand::rng().fill_bytes(&mut seed);
let sk = SigningKey::from_bytes(&seed);
// Create the file with mode 0600 at creation time (Unix) so the seed
// is never visible to other users even transiently.