summaryrefslogtreecommitdiffstats
path: root/components
diff options
context:
space:
mode:
authordougsteed <dougsteed@chromium.org>2014-09-19 11:46:09 -0700
committerCommit bot <commit-bot@chromium.org>2014-09-19 18:46:27 +0000
commit0cf460ec9f9b56c22c5101ff599e7e842c541089 (patch)
tree6e75cdfae5ce1b830e7b1f2e7116c9e3c79b308e /components
parent4da78f3fc41cc4adfcc75ab943893fc359f3d2c1 (diff)
downloadchromium_src-0cf460ec9f9b56c22c5101ff599e7e842c541089.zip
chromium_src-0cf460ec9f9b56c22c5101ff599e7e842c541089.tar.gz
chromium_src-0cf460ec9f9b56c22c5101ff599e7e842c541089.tar.bz2
Generalize crypto::SignatureCreator to allow choice of hash function, so as to support SHA256 (not just SHA1).
BUG=412531 R=rsleevi@chromium.org,davidben@chromium.org TBR=pfeldman@chromium.org Review URL: https://codereview.chromium.org/560583002 Cr-Commit-Position: refs/heads/master@{#295747}
Diffstat (limited to 'components')
-rw-r--r--components/ownership/owner_settings_service.cc3
-rw-r--r--components/policy/core/common/cloud/policy_builder.cc3
2 files changed, 4 insertions, 2 deletions
diff --git a/components/ownership/owner_settings_service.cc b/components/ownership/owner_settings_service.cc
index 09c88d3..56bcbe0 100644
--- a/components/ownership/owner_settings_service.cc
+++ b/components/ownership/owner_settings_service.cc
@@ -32,7 +32,8 @@ std::string AssembleAndSignPolicy(scoped_ptr<em::PolicyData> policy,
// Generate the signature.
scoped_ptr<crypto::SignatureCreator> signature_creator(
- crypto::SignatureCreator::Create(private_key));
+ crypto::SignatureCreator::Create(private_key,
+ crypto::SignatureCreator::SHA1));
signature_creator->Update(
reinterpret_cast<const uint8*>(policy_response.policy_data().c_str()),
policy_response.policy_data().size());
diff --git a/components/policy/core/common/cloud/policy_builder.cc b/components/policy/core/common/cloud/policy_builder.cc
index d6ea5ed..e0d3a1a 100644
--- a/components/policy/core/common/cloud/policy_builder.cc
+++ b/components/policy/core/common/cloud/policy_builder.cc
@@ -295,7 +295,8 @@ void PolicyBuilder::SignData(const std::string& data,
crypto::RSAPrivateKey* key,
std::string* signature) {
scoped_ptr<crypto::SignatureCreator> signature_creator(
- crypto::SignatureCreator::Create(key));
+ crypto::SignatureCreator::Create(key,
+ crypto::SignatureCreator::SHA1));
signature_creator->Update(reinterpret_cast<const uint8*>(data.c_str()),
data.size());
std::vector<uint8> signature_bytes;