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

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, 9 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
« no previous file with comments | « no previous file | chrome/browser/metrics/variations/variations_seed_store.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/metrics/variations/variations_seed_store.h
===================================================================
--- chrome/browser/metrics/variations/variations_seed_store.h (revision 255631)
+++ chrome/browser/metrics/variations/variations_seed_store.h (working copy)
@@ -8,6 +8,7 @@
#include <string>
#include "base/compiler_specific.h"
+#include "base/gtest_prod_util.h"
#include "base/time/time.h"
class PrefService;
@@ -45,7 +46,30 @@
// 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
+ // verification is not enabled.
+ virtual VariationsSeedStore::VerifySignatureResult VerifySeedSignature(
+ const std::string& seed_bytes,
+ const std::string& base64_seed_signature);
+
private:
+ FRIEND_TEST_ALL_PREFIXES(VariationsSeedStoreTest, VerifySeedSignature);
+
// Clears all prefs related to variations seed storage.
void ClearPrefs();
« no previous file with comments | « no previous file | chrome/browser/metrics/variations/variations_seed_store.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698