Chromium Code Reviews| Index: chrome/browser/policy/policy_builder.cc |
| diff --git a/chrome/browser/policy/policy_builder.cc b/chrome/browser/policy/policy_builder.cc |
| index dcd21658e7c158bd9f56af9d3e0f10efe6c5aa8c..2c7fa49fcc7e434f438701a908332a44ede20b16 100644 |
| --- a/chrome/browser/policy/policy_builder.cc |
| +++ b/chrome/browser/policy/policy_builder.cc |
| @@ -4,8 +4,6 @@ |
| #include "chrome/browser/policy/policy_builder.h" |
| -#include <vector> |
| - |
| #include "base/logging.h" |
| #include "base/stl_util.h" |
| #include "chrome/browser/policy/cloud_policy_constants.h" |
| @@ -122,7 +120,7 @@ void PolicyBuilder::Build() { |
| // Add the new public key. |
| std::vector<uint8> raw_new_public_signing_key; |
| - CHECK(new_signing_key_->ExportPublicKey(&raw_new_public_signing_key)); |
| + GetNewPublicKey(&raw_new_public_signing_key); |
| policy_.set_new_public_key(vector_as_array(&raw_new_public_signing_key), |
| raw_new_public_signing_key.size()); |
| @@ -144,6 +142,18 @@ std::string PolicyBuilder::GetBlob() { |
| return policy_.SerializeAsString(); |
| } |
| +void PolicyBuilder::GetPublicKey(std::vector<uint8>* public_key) { |
| + CHECK(public_key); |
| + CHECK(signing_key_); |
| + CHECK(signing_key_->ExportPublicKey(public_key)); |
|
Mattias Nissler (ping if slow)
2013/02/06 17:58:25
What's the value in adding these helpers?
Joao da Silva
2013/02/07 16:32:00
They're used in the unit test.
Mattias Nissler (ping if slow)
2013/02/08 13:36:42
Well, but the unit test could just call ExportPubl
Joao da Silva
2013/02/08 16:47:04
That's right, reverted these helpers.
|
| +} |
| + |
| +void PolicyBuilder::GetNewPublicKey(std::vector<uint8>* public_key) { |
| + CHECK(public_key); |
| + CHECK(new_signing_key_); |
| + CHECK(new_signing_key_->ExportPublicKey(public_key)); |
| +} |
| + |
| scoped_ptr<em::PolicyFetchResponse> PolicyBuilder::GetCopy() { |
| scoped_ptr<em::PolicyFetchResponse> result(new em::PolicyFetchResponse()); |
| result->CopyFrom(policy_); |