Chromium Code Reviews| 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); |
|
Andrew T Wilson (Slow)
2016/11/14 09:29:37
DCHECK(!allow_key_rotation_) ?
emaxx
2016/11/14 16:27:07
I intentionally omitted such DCHECKS in the second
|
| + 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( |