| Index: components/sync/engine_impl/commit.cc
|
| diff --git a/components/sync/engine_impl/commit.cc b/components/sync/engine_impl/commit.cc
|
| index 877ba4ca07983cf5524449ee07669a1ca2a81059..2c9485080023fe7bac84f37a608c42608cc13369 100644
|
| --- a/components/sync/engine_impl/commit.cc
|
| +++ b/components/sync/engine_impl/commit.cc
|
| @@ -27,8 +27,19 @@ namespace {
|
| // because it is not too large (to hurt performance and compression ratio), but
|
| // it is not too small to easily be canceled out using statistical analysis.
|
| const size_t kPaddingSize = 256;
|
| +
|
| +std::string RandASCIIString(size_t length) {
|
| + std::string result;
|
| + const int kMin = static_cast<int>(' ');
|
| + const int kMax = static_cast<int>('~');
|
| + result.reserve(length);
|
| + for (size_t i = 0; i < length; ++i)
|
| + result.push_back(static_cast<char>(base::RandInt(kMin, kMax)));
|
| + return result;
|
| }
|
|
|
| +} // namespace
|
| +
|
| Commit::Commit(ContributionMap contributions,
|
| const sync_pb::ClientToServerMessage& message,
|
| ExtensionsActivity::Records extensions_activity_buffer)
|
| @@ -69,7 +80,7 @@ Commit* Commit::Init(ModelTypeSet requested_types,
|
|
|
| // Set padding to mitigate CRIME attack.
|
| if (base::FeatureList::IsEnabled(syncer::kSyncClientToServerCompression)) {
|
| - commit_message->set_padding(base::RandBytesAsString(kPaddingSize));
|
| + commit_message->set_padding(RandASCIIString(kPaddingSize));
|
| }
|
|
|
| // Set extensions activity if bookmark commits are present.
|
|
|