| Index: components/webcrypto/algorithms/ecdh.cc
|
| diff --git a/components/webcrypto/algorithms/ecdh.cc b/components/webcrypto/algorithms/ecdh.cc
|
| index de82db439eda9585230b40bcef2df83b97973d1a..8afca5c2841359610bf960d1b39e6c70e64f8e5c 100644
|
| --- a/components/webcrypto/algorithms/ecdh.cc
|
| +++ b/components/webcrypto/algorithms/ecdh.cc
|
| @@ -79,20 +79,17 @@ class EcdhImplementation : public EcAlgorithm {
|
| return Status::ErrorEcdhCurveMismatch();
|
| }
|
|
|
| - crypto::ScopedEC_KEY public_key_ec(
|
| - EVP_PKEY_get1_EC_KEY(GetEVP_PKEY(public_key)));
|
| + EC_KEY* public_key_ec = EVP_PKEY_get0_EC_KEY(GetEVP_PKEY(public_key));
|
|
|
| - const EC_POINT* public_key_point =
|
| - EC_KEY_get0_public_key(public_key_ec.get());
|
| + const EC_POINT* public_key_point = EC_KEY_get0_public_key(public_key_ec);
|
|
|
| - crypto::ScopedEC_KEY private_key_ec(
|
| - EVP_PKEY_get1_EC_KEY(GetEVP_PKEY(base_key)));
|
| + EC_KEY* private_key_ec = EVP_PKEY_get0_EC_KEY(GetEVP_PKEY(base_key));
|
|
|
| // The size of the shared secret is the field size in bytes (rounded up).
|
| // Note that, if rounding was required, the most significant bits of the
|
| // secret are zero. So for P-521, the maximum length is 528 bits, not 521.
|
| - int field_size_bytes = NumBitsToBytes(
|
| - EC_GROUP_get_degree(EC_KEY_get0_group(private_key_ec.get())));
|
| + int field_size_bytes =
|
| + NumBitsToBytes(EC_GROUP_get_degree(EC_KEY_get0_group(private_key_ec)));
|
|
|
| // If a desired key length was not specified, default to the field size
|
| // (rounded up to nearest byte).
|
| @@ -115,7 +112,7 @@ class EcdhImplementation : public EcAlgorithm {
|
| derived_bytes->resize(NumBitsToBytes(length_bits));
|
|
|
| int result = ECDH_compute_key(derived_bytes->data(), derived_bytes->size(),
|
| - public_key_point, private_key_ec.get(), 0);
|
| + public_key_point, private_key_ec, 0);
|
| if (result < 0 || static_cast<size_t>(result) != derived_bytes->size())
|
| return Status::OperationError();
|
|
|
|
|