Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1241)

Unified Diff: net/quic/core/crypto/p256_key_exchange.cc

Issue 2400033005: Use BoringSSL scopers in //net. (Closed)
Patch Set: avoid some unnecessary refcount-bumping Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: net/quic/core/crypto/p256_key_exchange.cc
diff --git a/net/quic/core/crypto/p256_key_exchange.cc b/net/quic/core/crypto/p256_key_exchange.cc
index 6e401a6ace01211a329c4dda85930bf3657bb97a..2d48a88d92acdce46026aa53387493adcf9138ad 100644
--- a/net/quic/core/crypto/p256_key_exchange.cc
+++ b/net/quic/core/crypto/p256_key_exchange.cc
@@ -30,7 +30,7 @@ P256KeyExchange* P256KeyExchange::New(StringPiece key) {
}
const uint8_t* keyp = reinterpret_cast<const uint8_t*>(key.data());
- crypto::ScopedEC_KEY private_key(
+ bssl::UniquePtr<EC_KEY> private_key(
d2i_ECPrivateKey(nullptr, &keyp, key.size()));
if (!private_key.get() || !EC_KEY_check_key(private_key.get())) {
DVLOG(1) << "Private key is invalid.";
@@ -51,7 +51,7 @@ P256KeyExchange* P256KeyExchange::New(StringPiece key) {
// static
string P256KeyExchange::NewPrivateKey() {
- crypto::ScopedEC_KEY key(EC_KEY_new_by_curve_name(NID_X9_62_prime256v1));
+ bssl::UniquePtr<EC_KEY> key(EC_KEY_new_by_curve_name(NID_X9_62_prime256v1));
if (!key.get() || !EC_KEY_generate_key(key.get())) {
DVLOG(1) << "Can't generate a new private key.";
return string();
@@ -84,7 +84,7 @@ bool P256KeyExchange::CalculateSharedKey(StringPiece peer_public_value,
return false;
}
- crypto::ScopedEC_POINT point(
+ bssl::UniquePtr<EC_POINT> point(
EC_POINT_new(EC_KEY_get0_group(private_key_.get())));
if (!point ||
!EC_POINT_oct2point(/* also test if point is on curve */

Powered by Google App Engine
This is Rietveld 408576698