Chromium Code Reviews| Index: chrome/browser/metrics/variations/variations_seed_store.h |
| =================================================================== |
| --- chrome/browser/metrics/variations/variations_seed_store.h (revision 254843) |
| +++ chrome/browser/metrics/variations/variations_seed_store.h (working copy) |
| @@ -45,6 +45,27 @@ |
| // Registers Local State prefs used by this class. |
| static void RegisterPrefs(PrefRegistrySimple* registry); |
| + protected: |
| + // Note: UMA histogram enum - don't re-order or remove entries. |
| + enum VerifySignatureResult { |
| + VARIATIONS_SEED_SIGNATURE_MISSING, |
| + VARIATIONS_SEED_SIGNATURE_DECODE_FAILED, |
| + VARIATIONS_SEED_SIGNATURE_INVALID_SIGNATURE, |
| + VARIATIONS_SEED_SIGNATURE_INVALID_SEED, |
| + VARIATIONS_SEED_SIGNATURE_VALID, |
| + VARIATIONS_SEED_SIGNATURE_ENUM_SIZE, |
| + }; |
| + |
| + // Verifies a variations seed (the serialized proto bytes) with the specified |
| + // base-64 encoded signature that was received from the server and returns the |
| + // result. The signature is assumed to be an "ECDSA with SHA-256" signature |
| + // (see kECDSAWithSHA256AlgorithmID in the .cc file). Returns the result of |
| + // signature verification or VARIATIONS_SEED_SIGNATURE_ENUM_SIZE if signature |
|
jwd
2014/03/05 17:56:27
opt nit: Overloading VARIATIONS_SEED_SIGNATURE_ENU
Alexei Svitkine (slow)
2014/03/05 18:21:43
I considered making this function return a bool an
jwd
2014/03/05 18:36:00
No, not really. It's probably fine how it is.
|
| + // verification is not enabled. |
| + virtual VariationsSeedStore::VerifySignatureResult VerifySeedSignature( |
| + const std::string& seed_bytes, |
| + const std::string& base64_seed_signature); |
| + |
| private: |
| // Clears all prefs related to variations seed storage. |
| void ClearPrefs(); |