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

Unified Diff: net/cert/jwk_serializer.cc

Issue 2400033005: Use BoringSSL scopers in //net. (Closed)
Patch Set: eroman comments 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
« no previous file with comments | « net/cert/internal/verify_signed_data.cc ('k') | net/cert/x509_certificate_ios.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/cert/jwk_serializer.cc
diff --git a/net/cert/jwk_serializer.cc b/net/cert/jwk_serializer.cc
index 3a6a86d3e7c982df3ae38487a62c78467a7c1f72..bcd9545de3692ea419170fe7a56a09b42b3d2fd6 100644
--- a/net/cert/jwk_serializer.cc
+++ b/net/cert/jwk_serializer.cc
@@ -15,7 +15,6 @@
#include "base/strings/string_util.h"
#include "base/values.h"
#include "crypto/openssl_util.h"
-#include "crypto/scoped_openssl_types.h"
namespace net {
@@ -26,10 +25,10 @@ namespace {
bool ConvertEcKeyToJwk(EVP_PKEY* pkey,
base::DictionaryValue* public_key_jwk,
const crypto::OpenSSLErrStackTracer& err_tracer) {
- crypto::ScopedEC_KEY ec_key(EVP_PKEY_get1_EC_KEY(pkey));
+ EC_KEY* ec_key = EVP_PKEY_get0_EC_KEY(pkey);
if (!ec_key)
return false;
- const EC_GROUP* ec_group = EC_KEY_get0_group(ec_key.get());
+ const EC_GROUP* ec_group = EC_KEY_get0_group(ec_key);
if (!ec_group)
return false;
@@ -47,12 +46,12 @@ bool ConvertEcKeyToJwk(EVP_PKEY* pkey,
int degree_bytes = (EC_GROUP_get_degree(ec_group) + 7) / 8;
- const EC_POINT* ec_point = EC_KEY_get0_public_key(ec_key.get());
+ const EC_POINT* ec_point = EC_KEY_get0_public_key(ec_key);
if (!ec_point)
return false;
- crypto::ScopedBIGNUM x(BN_new());
- crypto::ScopedBIGNUM y(BN_new());
+ bssl::UniquePtr<BIGNUM> x(BN_new());
+ bssl::UniquePtr<BIGNUM> y(BN_new());
if (!EC_POINT_get_affine_coordinates_GFp(ec_group, ec_point, x.get(), y.get(),
NULL)) {
return false;
@@ -98,7 +97,7 @@ bool ConvertSpkiFromDerToJwk(const base::StringPiece& spki_der,
CBS cbs;
CBS_init(&cbs, reinterpret_cast<const uint8_t*>(spki_der.data()),
spki_der.size());
- crypto::ScopedEVP_PKEY pubkey(EVP_parse_public_key(&cbs));
+ bssl::UniquePtr<EVP_PKEY> pubkey(EVP_parse_public_key(&cbs));
if (!pubkey || CBS_len(&cbs) != 0)
return false;
« no previous file with comments | « net/cert/internal/verify_signed_data.cc ('k') | net/cert/x509_certificate_ios.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698