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

Unified Diff: components/policy/core/common/cloud/cloud_policy_validator.cc

Issue 2494843002: Don't pass domain and verification key to validation when not required (Closed)
Patch Set: Rebase Created 4 years, 1 month 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: components/policy/core/common/cloud/cloud_policy_validator.cc
diff --git a/components/policy/core/common/cloud/cloud_policy_validator.cc b/components/policy/core/common/cloud/cloud_policy_validator.cc
index ea5e0fa04659a12a5b7faebe871fd4c734d033e6..2bcdbc60c1a7ca1b5db126c046228f55d1e894c1 100644
--- a/components/policy/core/common/cloud/cloud_policy_validator.cc
+++ b/components/policy/core/common/cloud/cloud_policy_validator.cc
@@ -122,15 +122,21 @@ void CloudPolicyValidatorBase::ValidateCachedKey(
cached_key_signature_ = cached_key_signature;
}
-void CloudPolicyValidatorBase::ValidateSignature(
+void CloudPolicyValidatorBase::ValidateSignature(const std::string& key) {
+ validation_flags_ |= VALIDATE_SIGNATURE;
+ DCHECK(key_.empty() || key_ == key);
+ key_ = key;
+}
+
+void CloudPolicyValidatorBase::ValidateSignatureAllowingRotation(
const std::string& key,
const std::string& verification_key,
- const std::string& owning_domain,
- bool allow_key_rotation) {
+ const std::string& owning_domain) {
validation_flags_ |= VALIDATE_SIGNATURE;
- set_verification_key_and_domain(verification_key, owning_domain);
+ DCHECK(key_.empty() || key_ == key);
key_ = key;
- allow_key_rotation_ = allow_key_rotation;
+ set_verification_key_and_domain(verification_key, owning_domain);
+ allow_key_rotation_ = true;
}
void CloudPolicyValidatorBase::ValidateInitialKey(

Powered by Google App Engine
This is Rietveld 408576698