mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-04-02 18:55:32 +00:00
udp: ConnectionValidator: improve error on failure to gen key
This commit is contained in:
parent
38eecaeef2
commit
70414ee736
1 changed files with 2 additions and 1 deletions
|
|
@ -28,7 +28,8 @@ impl ConnectionValidator {
|
||||||
pub fn new(config: &Config) -> anyhow::Result<Self> {
|
pub fn new(config: &Config) -> anyhow::Result<Self> {
|
||||||
let mut key = [0; 32];
|
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);
|
let hmac = blake3::Hasher::new_keyed(&key);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue