Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2235)

Unified Diff: chrome/browser/metrics/variations/variations_seed_store.h

Issue 183003008: Enforce variations signature verification. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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();

Powered by Google App Engine
This is Rietveld 408576698