Change the WebCrypto behavior when exporting EC private keys that were imported witho...
commit6a87d7f37462fe33d0da8b730ce7f81e31063790
authoreroman <eroman@chromium.org>
Wed, 14 Jan 2015 22:32:00 +0000 (14 14:32 -0800)
committerCommit bot <commit-bot@chromium.org>
Wed, 14 Jan 2015 22:32:48 +0000 (14 22:32 +0000)
tree64a193f0e4c7608c0f91006eb28d3e5dc4d3f02f
parentb081bab860ed0b74824c7e6a268d7699b61541fc
Change the WebCrypto behavior when exporting EC private keys that were imported without a public key.

Before such keys were exported to PKCS8 format, the publicKey would be missing in the ECPrivateKey.

Now instead the publicKey is written to exported bytes even if it was not provided during import.

This is more consistent with how export works for JWK, where the public key is a required parameter.

It also speeds up the structured (de) cloning of such keys, which uses PKCS8 format under the hood (and for which if the publicKey was not provided, BoringSSL computes it).

BUG=445635

Review URL: https://codereview.chromium.org/835633002

Cr-Commit-Position: refs/heads/master@{#311553}
content/child/webcrypto/openssl/ec_algorithm_openssl.cc
content/child/webcrypto/test/ecdsa_unittest.cc
content/test/data/webcrypto/ec_private_keys.json