Commit 982c9dba authored by Daniel Rubery's avatar Daniel Rubery Committed by Commit Bot

Hex encode BinaryUploadService tokens

Tokens are passed as string fields in a proto, and therefore should
probably be valid UTF-8, but RandBytes won't generate valid UTF-8.
There's no immediate concerns here, but we don't want to run into
trouble if some system tries to validate the token field.

Bug: 980777
Change-Id: Iefe3391eff6325cfea732bc9004bb495754935d5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1814694
Auto-Submit: Daniel Rubery <drubery@chromium.org>
Commit-Queue: Bettina Dea <bdea@chromium.org>
Reviewed-by: default avatarBettina Dea <bdea@chromium.org>
Cr-Commit-Position: refs/heads/master@{#698612}
parent 3a2baa8c
......@@ -61,6 +61,7 @@ void BinaryUploadService::UploadForDeepScanning(
}
std::string token = base::RandBytesAsString(128);
token = base::HexEncode(token.data(), token.size());
active_tokens_[raw_request] = token;
binary_fcm_service_->SetCallbackForToken(
token, base::BindRepeating(&BinaryUploadService::OnGetResponse,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment