| Index: net/ssl/server_bound_cert_service.cc
|
| ===================================================================
|
| --- net/ssl/server_bound_cert_service.cc (revision 228925)
|
| +++ net/ssl/server_bound_cert_service.cc (working copy)
|
| @@ -98,20 +98,20 @@
|
| not_valid_before + base::TimeDelta::FromDays(kValidityPeriodInDays);
|
| std::string der_cert;
|
| std::vector<uint8> private_key_info;
|
| - scoped_ptr<crypto::ECPrivateKey> key(crypto::ECPrivateKey::Create());
|
| - if (!key.get()) {
|
| - DLOG(ERROR) << "Unable to create key pair for client";
|
| - *error = ERR_KEY_GENERATION_FAILED;
|
| - return result.Pass();
|
| - }
|
| - if (!x509_util::CreateDomainBoundCertEC(key.get(), server_identifier,
|
| - serial_number, not_valid_before,
|
| - not_valid_after, &der_cert)) {
|
| + crypto::ECPrivateKey* raw_key;
|
| + if (!x509_util::CreateKeyAndDomainBoundCertEC(server_identifier,
|
| + serial_number,
|
| + not_valid_before,
|
| + not_valid_after,
|
| + &raw_key,
|
| + &der_cert)) {
|
| DLOG(ERROR) << "Unable to create x509 cert for client";
|
| *error = ERR_ORIGIN_BOUND_CERT_GENERATION_FAILED;
|
| return result.Pass();
|
| }
|
|
|
| + scoped_ptr<crypto::ECPrivateKey> key(raw_key);
|
| +
|
| if (!key->ExportEncryptedPrivateKey(ServerBoundCertService::kEPKIPassword,
|
| 1, &private_key_info)) {
|
| DLOG(ERROR) << "Unable to export private key";
|
|
|