| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "components/policy/core/common/cloud/cloud_policy_validator.h" | 5 #include "components/policy/core/common/cloud/cloud_policy_validator.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 362 policy_.UnsetNewSigningKey(); | 362 policy_.UnsetNewSigningKey(); |
| 363 policy_.policy().set_new_public_key_signature("invalid"); | 363 policy_.policy().set_new_public_key_signature("invalid"); |
| 364 Validate(CheckStatus(CloudPolicyValidatorBase::VALIDATION_BAD_SIGNATURE)); | 364 Validate(CheckStatus(CloudPolicyValidatorBase::VALIDATION_BAD_SIGNATURE)); |
| 365 } | 365 } |
| 366 | 366 |
| 367 #if !defined(OS_CHROMEOS) | 367 #if !defined(OS_CHROMEOS) |
| 368 // Validation key is not currently checked on Chrome OS | 368 // Validation key is not currently checked on Chrome OS |
| 369 // (http://crbug.com/328038). | 369 // (http://crbug.com/328038). |
| 370 TEST_F(CloudPolicyValidatorTest, ErrorInvalidPublicKeyVerificationSignature) { | 370 TEST_F(CloudPolicyValidatorTest, ErrorInvalidPublicKeyVerificationSignature) { |
| 371 policy_.Build(); | 371 policy_.Build(); |
| 372 policy_.policy().set_new_public_key_verification_signature("invalid"); | 372 policy_.policy().set_new_public_key_verification_signature_deprecated( |
| 373 "invalid"); |
| 373 ValidatePolicy(CheckStatus( | 374 ValidatePolicy(CheckStatus( |
| 374 CloudPolicyValidatorBase::VALIDATION_BAD_KEY_VERIFICATION_SIGNATURE), | 375 CloudPolicyValidatorBase::VALIDATION_BAD_KEY_VERIFICATION_SIGNATURE), |
| 375 policy_.GetCopy()); | 376 policy_.GetCopy()); |
| 376 } | 377 } |
| 377 | 378 |
| 378 TEST_F(CloudPolicyValidatorTest, ErrorDomainMismatchForKeyVerification) { | 379 TEST_F(CloudPolicyValidatorTest, ErrorDomainMismatchForKeyVerification) { |
| 379 policy_.Build(); | 380 policy_.Build(); |
| 380 // Generate a non-matching owning_domain, which should cause a validation | 381 // Generate a non-matching owning_domain, which should cause a validation |
| 381 // failure. | 382 // failure. |
| 382 owning_domain_ = "invalid.com"; | 383 owning_domain_ = "invalid.com"; |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 430 | 431 |
| 431 TEST_F(CloudPolicyValidatorTest, NoRotation) { | 432 TEST_F(CloudPolicyValidatorTest, NoRotation) { |
| 432 allow_key_rotation_ = false; | 433 allow_key_rotation_ = false; |
| 433 policy_.UnsetNewSigningKey(); | 434 policy_.UnsetNewSigningKey(); |
| 434 Validate(CheckStatus(CloudPolicyValidatorBase::VALIDATION_OK)); | 435 Validate(CheckStatus(CloudPolicyValidatorBase::VALIDATION_OK)); |
| 435 } | 436 } |
| 436 | 437 |
| 437 } // namespace | 438 } // namespace |
| 438 | 439 |
| 439 } // namespace policy | 440 } // namespace policy |
| OLD | NEW |