From 7d77f5745953812dbf251829712549853c66585c Mon Sep 17 00:00:00 2001 From: Nick Richardson Date: Thu, 14 Nov 2024 20:52:38 -0800 Subject: [PATCH] Narrow secret sample fields to appropriate bit width Summary: Narrows secret_len and NSS_secret_label to u8 from u64. Reviewed By: mingtaoy Differential Revision: D64866451 fbshipit-source-id: 17a98cc0742c8fd91fc67ad4441b8090c3ba135c --- fizz/client/AsyncFizzClient-inl.h | 2 +- fizz/server/AsyncFizzServer-inl.h | 2 +- fizz/util/Tracing.cpp | 4 ++-- fizz/util/Tracing.h | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/fizz/client/AsyncFizzClient-inl.h b/fizz/client/AsyncFizzClient-inl.h index ed4ee42be7f..6ae4d45bb01 100644 --- a/fizz/client/AsyncFizzClient-inl.h +++ b/fizz/client/AsyncFizzClient-inl.h @@ -662,8 +662,8 @@ template void AsyncFizzClientT::ActionMoveVisitor::operator()( SecretAvailable& secret) { fizz_probe_secret_available( - secret.secret.secret.size(), secret.secret.secret.data(), + secret.secret.secret.size(), KeyLogWriter::secretToNSSLabel(secret.secret.type) .value_or(std::numeric_limits::max()), client_.getClientRandom()->data()); diff --git a/fizz/server/AsyncFizzServer-inl.h b/fizz/server/AsyncFizzServer-inl.h index 5f98d5cfd25..62e889b0328 100644 --- a/fizz/server/AsyncFizzServer-inl.h +++ b/fizz/server/AsyncFizzServer-inl.h @@ -381,8 +381,8 @@ template void AsyncFizzServerT::ActionMoveVisitor::operator()( SecretAvailable& secret) { fizz_probe_secret_available( - secret.secret.secret.size(), secret.secret.secret.data(), + secret.secret.secret.size(), KeyLogWriter::secretToNSSLabel(secret.secret.type) .value_or(std::numeric_limits::max()), server_.getClientRandom()->data()); diff --git a/fizz/util/Tracing.cpp b/fizz/util/Tracing.cpp index 388163614d8..4e91f4a95d9 100644 --- a/fizz/util/Tracing.cpp +++ b/fizz/util/Tracing.cpp @@ -12,15 +12,15 @@ namespace fizz { extern "C" { void fizz_probe_secret_available( - long unsigned int secretSize, unsigned char* secretData, + unsigned char secretSize, fizz::KeyLogWriter::Label nssLabel, unsigned char* clientRandom) { FOLLY_SDT( fizz, fizz_secret_available, - secretSize, secretData, + secretSize, nssLabel, clientRandom); } diff --git a/fizz/util/Tracing.h b/fizz/util/Tracing.h index 2275a4cde0b..75abdc762e7 100644 --- a/fizz/util/Tracing.h +++ b/fizz/util/Tracing.h @@ -13,8 +13,8 @@ namespace fizz { extern "C" { void fizz_probe_secret_available( - long unsigned int secretSize, unsigned char* secretData, + unsigned char secretSize, fizz::KeyLogWriter::Label nssLabel, unsigned char* clientRandom); }