udp: ConnectionValidator: improve error on failure to gen key

This commit is contained in:
Joakim Frostegård 2022-04-14 17:12:16 +02:00
parent 38eecaeef2
commit 70414ee736

View file

@ -28,7 +28,8 @@ impl ConnectionValidator {
pub fn new(config: &Config) -> anyhow::Result<Self> {
let mut key = [0; 32];
getrandom(&mut key).with_context(|| "Couldn't get random bytes from system source")?;
getrandom(&mut key)
.with_context(|| "Couldn't get random bytes for ConnectionValidator key")?;
let hmac = blake3::Hasher::new_keyed(&key);