chromium/components/sync/nigori/nigori_state.cc

// Copyright 2019 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "components/sync/nigori/nigori_state.h"

#include <cstdint>
#include <vector>

#include "base/base64.h"
#include "base/check_op.h"
#include "base/feature_list.h"
#include "base/metrics/histogram_functions.h"
#include "base/notreached.h"
#include "components/sync/base/data_type.h"
#include "components/sync/base/features.h"
#include "components/sync/base/time.h"
#include "components/sync/engine/nigori/cross_user_sharing_public_key.h"
#include "components/sync/engine/nigori/key_derivation_params.h"
#include "components/sync/engine/sync_encryption_handler.h"
#include "components/sync/nigori/cryptographer_impl.h"
#include "components/sync/nigori/keystore_keys_cryptographer.h"
#include "components/sync/protocol/nigori_local_data.pb.h"
#include "components/sync/protocol/nigori_specifics.pb.h"

namespace syncer {

namespace {

// When enabled, if the local state does not contain the private key for the
// current version, the key pair will be removed and re-generated.
BASE_FEATURE();

// These values are persisted to UMA. Entries should not be renumbered and
// numeric values should never be reused.
// LINT.IfChange(CrossUserSharingKeyPairState)
enum class CrossUserSharingKeyPairState {};
// LINT.ThenChange(/tools/metrics/histograms/metadata/sync/enums.xml:CrossUserSharingKeyPairState)

sync_pb::CustomPassphraseKeyDerivationParams
CustomPassphraseKeyDerivationParamsToProto(const KeyDerivationParams& params) {}

KeyDerivationParams CustomPassphraseKeyDerivationParamsFromProto(
    const sync_pb::CustomPassphraseKeyDerivationParams& proto) {}

// |encrypted| must not be null.
bool EncryptEncryptionKeys(const CryptographerImpl& cryptographer,
                           sync_pb::EncryptedData* encrypted) {}

void UpdateSpecificsFromKeyDerivationParams(
    const KeyDerivationParams& params,
    sync_pb::NigoriSpecifics* specifics) {}

std::optional<CrossUserSharingPublicKey> PublicKeyFromProto(
    const sync_pb::CrossUserSharingPublicKey& public_key) {}

sync_pb::CrossUserSharingPublicKey PublicKeyToProto(
    const CrossUserSharingPublicKey& public_key,
    uint32_t key_pair_version) {}

CrossUserSharingKeyPairState GetCrossUserSharingPublicKeyState(
    const NigoriState& state) {}

}  // namespace

// static
NigoriState NigoriState::CreateFromLocalProto(
    const sync_pb::NigoriModel& proto) {}

NigoriState::NigoriState()
    :{}

NigoriState::NigoriState(NigoriState&& other) = default;

NigoriState::~NigoriState() = default;

NigoriState& NigoriState::operator=(NigoriState&& other) = default;

sync_pb::NigoriModel NigoriState::ToLocalProto() const {}

sync_pb::NigoriSpecifics NigoriState::ToSpecificsProto() const {}

NigoriState NigoriState::Clone() const {}

bool NigoriState::NeedsKeystoreReencryption() const {}

DataTypeSet NigoriState::GetEncryptedTypes() const {}

bool NigoriState::NeedsGenerateCrossUserSharingKeyPair() const {}

}  // namespace syncer