enum ValidationResult {
INVALID,
VALID,
- VALID_LEGACY,
+ // Valid under a deprecated but as secure algorithm.
+ VALID_SECURE_LEGACY,
};
// Constructs a PrefHashCalculator using |seed| and |device_id|. The same
// |device_id| may be empty.
PrefHashCalculator(const std::string& seed, const std::string& device_id);
+ ~PrefHashCalculator();
+
// Calculates a hash value for the supplied preference |path| and |value|.
// |value| may be null if the preference has no value.
std::string Calculate(const std::string& path, const base::Value* value)
const std::string& hash) const;
private:
- // Concatenates |device_id_|, |path|, and |value_as_string| to give the hash
- // input.
- std::string GetMessage(const std::string& path,
- const std::string& value_as_string) const;
-
- std::string seed_;
- std::string device_id_;
+ const std::string seed_;
+ const std::string device_id_;
+ const std::string legacy_device_id_;
DISALLOW_COPY_AND_ASSIGN(PrefHashCalculator);
};