From 70414ee736fe17edbeae702d0817ad05ca9f1a12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Frosteg=C3=A5rd?= Date: Thu, 14 Apr 2022 17:12:16 +0200 Subject: [PATCH] udp: ConnectionValidator: improve error on failure to gen key --- aquatic_udp/src/common.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/aquatic_udp/src/common.rs b/aquatic_udp/src/common.rs index 6609914..ddb80f3 100644 --- a/aquatic_udp/src/common.rs +++ b/aquatic_udp/src/common.rs @@ -28,7 +28,8 @@ impl ConnectionValidator { pub fn new(config: &Config) -> anyhow::Result { 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);