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

Issue 361193003: Eliminate ScopedOpenSSL in favour of scoped_ptr<> specializations. (Closed)

Created:
6 years, 5 months ago by Ryan Sleevi
Modified:
6 years, 5 months ago
Reviewers:
Jeffrey Yasskin, eroman, wtc
CC:
chromium-reviews, darin-cc_chromium.org, cbentzel+watch_chromium.org, jam
Project:
chromium
Visibility:
Public.

Description

Eliminate ScopedOpenSSL in favour of scoped_ptr<> specializations. Match the NSS, CryptoAPI (Win) and Security (OS X) approaches by declaring the scoped types as specializations of our existing scoped classes. Like NSS, this requires an intermediate helper type, because our scoped_ptr<> doesn't accept deleter functions as template arguments (though they are valid in C++11's unique_ptr<>). A few base cryptographic (non-certificate) types are used in scoped_openssl_types.h, while the remainder are left for implementations to specialize as needed. In an ideal world, this would be scoped_ptr<FOO, FOO_free>, but that will require unique_ptr<> support. BUG=388904 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=282257

Patch Set 1 #

Patch Set 2 : Android fixes #

Total comments: 8

Patch Set 3 : Review feedback #

Total comments: 1

Patch Set 4 : Bump #

Patch Set 5 : Rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+274 lines, -253 lines) Patch
M chrome/common/net/x509_certificate_model_openssl.cc View 1 2 3 4 18 chunks +24 lines, -22 lines 0 comments Download
M content/child/webcrypto/platform_crypto_openssl.cc View 1 2 4 chunks +5 lines, -3 lines 0 comments Download
M crypto/ec_private_key_openssl.cc View 1 2 9 chunks +22 lines, -24 lines 0 comments Download
M crypto/ec_signature_creator_openssl.cc View 1 2 3 chunks +9 lines, -2 lines 0 comments Download
M crypto/openssl_bio_string_unittest.cc View 3 chunks +7 lines, -3 lines 0 comments Download
M crypto/openssl_util.h View 1 chunk +0 lines, -30 lines 0 comments Download
M crypto/rsa_private_key_openssl.cc View 1 2 4 chunks +6 lines, -5 lines 0 comments Download
A crypto/scoped_openssl_types.h View 1 2 3 1 chunk +49 lines, -0 lines 0 comments Download
M crypto/signature_verifier_openssl.cc View 1 2 4 chunks +5 lines, -6 lines 0 comments Download
M net/android/keystore_openssl.cc View 1 2 7 chunks +7 lines, -10 lines 0 comments Download
M net/android/keystore_unittest.cc View 1 2 19 chunks +35 lines, -41 lines 0 comments Download
M net/base/keygen_handler_openssl.cc View 1 2 2 chunks +3 lines, -2 lines 0 comments Download
M net/base/openssl_private_key_store_android.cc View 1 2 2 chunks +3 lines, -3 lines 0 comments Download
M net/cert/cert_database_openssl.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M net/cert/cert_verify_proc_openssl.cc View 1 2 2 chunks +3 lines, -2 lines 0 comments Download
M net/cert/ct_log_verifier_openssl.cc View 2 chunks +2 lines, -1 line 0 comments Download
M net/cert/x509_certificate_openssl.cc View 1 2 6 chunks +9 lines, -6 lines 0 comments Download
M net/cert/x509_util_openssl.cc View 1 2 10 chunks +34 lines, -27 lines 0 comments Download
M net/cert/x509_util_openssl_unittest.cc View 1 2 5 chunks +7 lines, -7 lines 0 comments Download
M net/net.gyp View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M net/net.gypi View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M net/quic/crypto/channel_id_openssl.cc View 1 2 4 chunks +5 lines, -5 lines 0 comments Download
M net/quic/crypto/p256_key_exchange.h View 2 chunks +2 lines, -4 lines 0 comments Download
M net/quic/crypto/p256_key_exchange_openssl.cc View 1 2 3 chunks +3 lines, -5 lines 0 comments Download
M net/quic/test_tools/crypto_test_utils_openssl.cc View 1 2 5 chunks +9 lines, -17 lines 0 comments Download
M net/socket/ssl_client_socket_openssl.cc View 1 2 4 chunks +9 lines, -7 lines 0 comments Download
M net/socket/ssl_client_socket_openssl_unittest.cc View 1 2 3 chunks +4 lines, -14 lines 0 comments Download
M net/socket/ssl_server_socket_openssl.cc View 1 2 3 chunks +4 lines, -3 lines 0 comments Download
M net/socket/ssl_session_cache_openssl_unittest.cc View 1 2 3 chunks +4 lines, -2 lines 0 comments Download

Messages

Total messages: 16 (0 generated)
Ryan Sleevi
eroman: net/ and content/ and chrome/, and if you're happy, I'll push to wtc for ...
6 years, 5 months ago (2014-07-02 06:17:37 UTC) #1
wtc
Patch set 2 LGTM. https://codereview.chromium.org/361193003/diff/20001/crypto/ec_signature_creator_openssl.cc File crypto/ec_signature_creator_openssl.cc (right): https://codereview.chromium.org/361193003/diff/20001/crypto/ec_signature_creator_openssl.cc#newcode23 crypto/ec_signature_creator_openssl.cc:23: ScopedECDSA_SIG; You can use the ...
6 years, 5 months ago (2014-07-02 20:13:13 UTC) #2
Ryan Sleevi
https://codereview.chromium.org/361193003/diff/20001/crypto/scoped_openssl_types.h File crypto/scoped_openssl_types.h (right): https://codereview.chromium.org/361193003/diff/20001/crypto/scoped_openssl_types.h#newcode41 crypto/scoped_openssl_types.h:41: typedef scoped_ptr<RSA, OpenSSLDestroyer<RSA, RSA_free> > ScopedRSA; On 2014/07/02 20:13:13, ...
6 years, 5 months ago (2014-07-02 20:16:30 UTC) #3
wtc
https://codereview.chromium.org/361193003/diff/20001/crypto/scoped_openssl_types.h File crypto/scoped_openssl_types.h (right): https://codereview.chromium.org/361193003/diff/20001/crypto/scoped_openssl_types.h#newcode41 crypto/scoped_openssl_types.h:41: typedef scoped_ptr<RSA, OpenSSLDestroyer<RSA, RSA_free> > ScopedRSA; On 2014/07/02 20:16:29, ...
6 years, 5 months ago (2014-07-02 20:22:00 UTC) #4
Jeffrey Yasskin
This will actually remain the right thing to do even in a unique_ptr world because ...
6 years, 5 months ago (2014-07-02 20:22:34 UTC) #5
Ryan Sleevi
On 2014/07/02 20:22:34, Jeffrey Yasskin wrote: > This will actually remain the right thing to ...
6 years, 5 months ago (2014-07-02 20:50:48 UTC) #6
Jeffrey Yasskin
On 2014/07/02 20:50:48, Ryan Sleevi wrote: > On 2014/07/02 20:22:34, Jeffrey Yasskin wrote: > > ...
6 years, 5 months ago (2014-07-02 21:05:23 UTC) #7
eroman
I find this new abstraction less readable than ScopedOpenSSL. Why not keep a named type ...
6 years, 5 months ago (2014-07-07 21:32:20 UTC) #8
Ryan Sleevi
On 2014/07/07 21:32:20, eroman wrote: > I find this new abstraction less readable than ScopedOpenSSL. ...
6 years, 5 months ago (2014-07-07 21:40:00 UTC) #9
eroman
The inconsistency is in where verbosity is eliminated. Things like ScopedBIO already hide the fact ...
6 years, 5 months ago (2014-07-07 21:56:20 UTC) #10
wtc
https://codereview.chromium.org/361193003/diff/20001/chrome/common/net/x509_certificate_model_openssl.cc File chrome/common/net/x509_certificate_model_openssl.cc (right): https://codereview.chromium.org/361193003/diff/20001/chrome/common/net/x509_certificate_model_openssl.cc#newcode461 chrome/common/net/x509_certificate_model_openssl.cc:461: crypto::OpenSSLDestroyer<ASN1_BIT_STRING, ASN1_BIT_STRING_free> > I also find the new code ...
6 years, 5 months ago (2014-07-09 15:08:15 UTC) #11
Ryan Sleevi
eroman: After playing a bit more with the templates, and being depressed by everything, I ...
6 years, 5 months ago (2014-07-10 01:31:19 UTC) #12
eroman
lgtm https://codereview.chromium.org/361193003/diff/40001/crypto/scoped_openssl_types.h File crypto/scoped_openssl_types.h (right): https://codereview.chromium.org/361193003/diff/40001/crypto/scoped_openssl_types.h#newcode1 crypto/scoped_openssl_types.h:1: // Copyright (c) 2012 The Chromium Authors. All ...
6 years, 5 months ago (2014-07-10 01:38:59 UTC) #13
Ryan Sleevi
The CQ bit was checked by rsleevi@chromium.org
6 years, 5 months ago (2014-07-10 01:57:41 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rsleevi@chromium.org/361193003/80001
6 years, 5 months ago (2014-07-10 01:59:20 UTC) #15
commit-bot: I haz the power
6 years, 5 months ago (2014-07-10 04:39:44 UTC) #16
Message was sent while issue was closed.
Change committed as 282257

Powered by Google App Engine
This is Rietveld 408576698