fix(irtt): treat blank HMAC keys as unauthenticated
This commit is contained in:
2 files changed
+2
-1
No files matched your search
@@ -76,3 +76,4 @@ config reflector
|
|||||||
Use `list files '/path/to/reflectors.csv'` instead of `option files 'none'` to
|
Use `list files '/path/to/reflectors.csv'` instead of `option files 'none'` to
|
||||||
combine CSV files with inline reflectors. Omitting `files` keeps the default CSV;
|
combine CSV files with inline reflectors. Omitting `files` keeps the default CSV;
|
||||||
UCI discards empty string options, so `option files ''` does not disable it.
|
UCI discards empty string options, so `option files ''` does not disable it.
|
||||||
|
Absent or blank `irtt_hmac` values use unauthenticated IRTT sessions.
|
||||||
@@ -119,7 +119,7 @@ impl IrttEngine {
|
|||||||
TargetId::new(binding.stream.id.0.to_string()),
|
TargetId::new(binding.stream.id.0.to_string()),
|
||||||
SocketAddr::new(binding.stream.peer, binding.port).to_string(),
|
SocketAddr::new(binding.stream.peer, binding.port).to_string(),
|
||||||
);
|
);
|
||||||
if let Some(key) = &binding.hmac {
|
if let Some(key) = binding.hmac.as_ref().filter(|key| !key.trim().is_empty()) {
|
||||||
target.auth = TargetAuth::Override(irtt_client::Authentication::Hmac(
|
target.auth = TargetAuth::Override(irtt_client::Authentication::Hmac(
|
||||||
irtt_client::HmacKey::new(key.as_bytes().to_vec().into_boxed_slice()),
|
irtt_client::HmacKey::new(key.as_bytes().to_vec().into_boxed_slice()),
|
||||||
));
|
));
|
||||||
|
|||||||
Reference in new issue
Block a user