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

Issue 1898383003: RTCCertificate serialization. (Closed)

Created:
4 years, 8 months ago by hbos
Modified:
4 years, 7 months ago
CC:
webrtc-reviews_webrtc.org, tterriberry_mozilla.com
Base URL:
https://chromium.googlesource.com/external/webrtc.git@master
Target Ref:
refs/pending/heads/master
Project:
webrtc
Visibility:
Public.

Description

RTCCertificate serialization. This CL adds the ability to convert RTCCertificate objects to and from PEM string representations of it (its private key and certificate). The RTCCertificate being a wrapper of SSLIdentity, this is where the meat is. Changes: - SSLIdentity::PrivateKeyToPEMString() added. It together with the already existing SSLCertificate::ToPEMString() yields both private key and certificate PEM strings, both of which are required parameters to SSLIdentity::FromPEMStrings(). - Its only implementation, OpenSSLIdentity::PrivateKeyToPemString(). - SSLIdentity::PublicKeyToPEMString() added, used by tests. - sslidentity_unittest.cc updated: * FromPEMStringsRSA and FromPEMStringsEC updated. * CloneIdentityRSA and CloneIdentityECDSA added. - RTCCertificate::To/FromPem added, using new class RTCCertificatePem. - rtccertificate_unittest.cc: New test CloneWithPemSerialization. - Renamed rtc_unittests.cc to rtccertificate_unittest.cc to match convention. BUG=webrtc:5794, chromium:581354 Committed: https://crrev.com/6b470a9413d2e65dd9078a63ed3f5f60e5ba5232 Cr-Commit-Position: refs/heads/master@{#12546}

Patch Set 1 #

Patch Set 2 : Handle PEM_write_bio_PrivateKey failure #

Total comments: 2

Patch Set 3 : Verifying expiration time of clone #

Total comments: 15

Patch Set 4 : Equality tests using EVP_PKEY_cmp and X509_cmp #

Patch Set 5 : Addressed nisse's comments #

Total comments: 8

Patch Set 6 : Function renames. OpenSSLKeyPair::FromPrivateKeyPEMString. Check no missing params. #

Patch Set 7 : PublicKeyToPEMString #

Total comments: 16

Patch Set 8 : Addressed torbjorng's comments #

Total comments: 6

Patch Set 9 : Updated comments as per hta suggestions #

Patch Set 10 : Rebase with master (std::unique_ptr) #

Unified diffs Side-by-side diffs Delta from patch set Stats (+343 lines, -183 lines) Patch
M webrtc/base/base_tests.gyp View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -1 line 0 comments Download
M webrtc/base/fakesslidentity.h View 1 2 3 4 5 6 7 8 9 1 chunk +12 lines, -0 lines 0 comments Download
M webrtc/base/opensslidentity.h View 1 2 3 4 5 6 7 8 9 3 chunks +15 lines, -1 line 0 comments Download
M webrtc/base/opensslidentity.cc View 1 2 3 4 5 6 7 8 9 5 chunks +106 lines, -15 lines 0 comments Download
M webrtc/base/rtccertificate.h View 1 2 3 4 5 6 7 8 9 2 chunks +28 lines, -0 lines 0 comments Download
M webrtc/base/rtccertificate.cc View 1 2 3 4 5 6 7 8 9 1 chunk +20 lines, -0 lines 0 comments Download
A + webrtc/base/rtccertificate_unittest.cc View 1 2 3 4 5 6 7 8 9 3 chunks +26 lines, -4 lines 0 comments Download
D webrtc/base/rtccertificate_unittests.cc View 1 2 3 4 5 6 7 8 9 1 chunk +0 lines, -118 lines 0 comments Download
M webrtc/base/sslidentity.h View 1 2 3 4 5 6 7 8 9 2 chunks +5 lines, -0 lines 0 comments Download
M webrtc/base/sslidentity.cc View 1 2 3 4 5 1 chunk +8 lines, -0 lines 0 comments Download
M webrtc/base/sslidentity_unittest.cc View 1 2 3 4 5 6 7 8 9 2 chunks +122 lines, -44 lines 0 comments Download

Messages

Total messages: 43 (15 generated)
hbos
Please take a look, torbjorng and hta. Should I also add another crypto reviewer that ...
4 years, 8 months ago (2016-04-20 15:37:13 UTC) #4
torbjorng (webrtc)
I think it would be good if nisse took a look at this CL too.
4 years, 8 months ago (2016-04-20 21:34:26 UTC) #6
hbos
I did a minor update, verifying that the clone's expiration time is the same as ...
4 years, 8 months ago (2016-04-21 09:55:19 UTC) #7
torbjorng (webrtc)
By using X509_cmp as suggested, you should be able to avoid changing the format of ...
4 years, 8 months ago (2016-04-21 15:16:00 UTC) #8
nisse-webrtc
I'm not very familiar with openssl. But I have a couple of comments and questions. ...
4 years, 8 months ago (2016-04-22 11:38:25 UTC) #9
hbos
PTAL torbjorng, nisse. Two more patch sets! https://codereview.webrtc.org/1898383003/diff/40001/webrtc/base/fakesslidentity.h File webrtc/base/fakesslidentity.h (right): https://codereview.webrtc.org/1898383003/diff/40001/webrtc/base/fakesslidentity.h#newcode101 webrtc/base/fakesslidentity.h:101: virtual std::string ...
4 years, 8 months ago (2016-04-22 13:19:29 UTC) #10
nisse-webrtc
https://codereview.webrtc.org/1898383003/diff/40001/webrtc/base/fakesslidentity.h File webrtc/base/fakesslidentity.h (right): https://codereview.webrtc.org/1898383003/diff/40001/webrtc/base/fakesslidentity.h#newcode101 webrtc/base/fakesslidentity.h:101: virtual std::string PrivateKeyToPemString() const { On 2016/04/22 13:19:29, hbos ...
4 years, 8 months ago (2016-04-22 13:44:07 UTC) #11
hbos
PTAL nisse, torbjorng. Some confusion around key pair and only using private key. We're working ...
4 years, 8 months ago (2016-04-25 14:23:23 UTC) #14
hbos
I also verified that the public key exists by printing it. I'll add a getter ...
4 years, 8 months ago (2016-04-25 15:18:58 UTC) #15
hbos
PTAL nisse, torbjorng. Now we still read and write the private key but we make ...
4 years, 8 months ago (2016-04-25 18:37:24 UTC) #16
torbjorng (webrtc)
You might want to move to unique_ptr as per kwiberg's comments to the webrtc list. ...
4 years, 8 months ago (2016-04-26 13:35:51 UTC) #18
hta-webrtc
Drive-by metacomment. https://codereview.webrtc.org/1898383003/diff/160001/webrtc/base/sslidentity_unittest.cc File webrtc/base/sslidentity_unittest.cc (right): https://codereview.webrtc.org/1898383003/diff/160001/webrtc/base/sslidentity_unittest.cc#newcode272 webrtc/base/sslidentity_unittest.cc:272: "-----BEGIN PRIVATE KEY-----\n" On 2016/04/26 13:35:51, torbjorng ...
4 years, 8 months ago (2016-04-26 14:10:16 UTC) #19
torbjorng (webrtc)
What I wanted to say is that we should accept both format variants, unless that ...
4 years, 8 months ago (2016-04-26 14:37:48 UTC) #20
hbos
PTAL torbjorng, nisse. The comparison operators use OpenSSL library calls, i.e. do binary compares, only ...
4 years, 8 months ago (2016-04-27 07:52:09 UTC) #21
nisse-webrtc
https://codereview.webrtc.org/1898383003/diff/80001/webrtc/base/opensslidentity.cc File webrtc/base/opensslidentity.cc (right): https://codereview.webrtc.org/1898383003/diff/80001/webrtc/base/opensslidentity.cc#newcode185 webrtc/base/opensslidentity.cc:185: BIO* temp_memory_bio = BIO_new(BIO_s_mem()); On 2016/04/25 14:23:23, hbos wrote: ...
4 years, 8 months ago (2016-04-27 08:05:46 UTC) #22
nisse-webrtc
On 2016/04/27 07:52:09, hbos wrote: > PTAL torbjorng, nisse. > > The comparison operators use ...
4 years, 8 months ago (2016-04-27 08:16:25 UTC) #23
hbos
On 2016/04/27 08:16:25, nisse-webrtc wrote: > On 2016/04/27 07:52:09, hbos wrote: > > PTAL torbjorng, ...
4 years, 8 months ago (2016-04-27 09:00:25 UTC) #24
hbos
https://codereview.webrtc.org/1898383003/diff/80001/webrtc/base/opensslidentity.cc File webrtc/base/opensslidentity.cc (right): https://codereview.webrtc.org/1898383003/diff/80001/webrtc/base/opensslidentity.cc#newcode185 webrtc/base/opensslidentity.cc:185: BIO* temp_memory_bio = BIO_new(BIO_s_mem()); On 2016/04/27 08:05:46, nisse-webrtc wrote: ...
4 years, 8 months ago (2016-04-27 09:00:45 UTC) #25
nisse-webrtc
lgtm https://codereview.webrtc.org/1898383003/diff/80001/webrtc/base/opensslidentity.cc File webrtc/base/opensslidentity.cc (right): https://codereview.webrtc.org/1898383003/diff/80001/webrtc/base/opensslidentity.cc#newcode185 webrtc/base/opensslidentity.cc:185: BIO* temp_memory_bio = BIO_new(BIO_s_mem()); On 2016/04/27 09:00:44, hbos ...
4 years, 8 months ago (2016-04-27 09:08:57 UTC) #26
torbjorng (webrtc)
lgtm
4 years, 8 months ago (2016-04-27 09:31:26 UTC) #27
hbos
Awesome. PTAL hta! https://codereview.webrtc.org/1898383003/diff/80001/webrtc/base/opensslidentity.cc File webrtc/base/opensslidentity.cc (right): https://codereview.webrtc.org/1898383003/diff/80001/webrtc/base/opensslidentity.cc#newcode185 webrtc/base/opensslidentity.cc:185: BIO* temp_memory_bio = BIO_new(BIO_s_mem()); On 2016/04/27 ...
4 years, 8 months ago (2016-04-27 10:12:08 UTC) #28
hta-webrtc
lgtm my only comments are on comments. https://codereview.webrtc.org/1898383003/diff/180001/webrtc/base/rtccertificate.h File webrtc/base/rtccertificate.h (right): https://codereview.webrtc.org/1898383003/diff/180001/webrtc/base/rtccertificate.h#newcode25 webrtc/base/rtccertificate.h:25: // cloning ...
4 years, 7 months ago (2016-04-28 10:18:13 UTC) #29
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1898383003/200001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1898383003/200001
4 years, 7 months ago (2016-04-28 10:43:05 UTC) #32
commit-bot: I haz the power
Try jobs failed on following builders: ios32_sim_dbg on tryserver.webrtc (JOB_FAILED, http://build.chromium.org/p/tryserver.webrtc/builders/ios32_sim_dbg/builds/7059) ios64_sim_dbg on tryserver.webrtc (JOB_FAILED, ...
4 years, 7 months ago (2016-04-28 10:44:13 UTC) #34
hbos
https://codereview.webrtc.org/1898383003/diff/180001/webrtc/base/rtccertificate.h File webrtc/base/rtccertificate.h (right): https://codereview.webrtc.org/1898383003/diff/180001/webrtc/base/rtccertificate.h#newcode25 webrtc/base/rtccertificate.h:25: // cloning and storing of certificates to disk. On ...
4 years, 7 months ago (2016-04-28 10:44:37 UTC) #35
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1898383003/220001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1898383003/220001
4 years, 7 months ago (2016-04-28 10:59:12 UTC) #38
commit-bot: I haz the power
Committed patchset #10 (id:220001)
4 years, 7 months ago (2016-04-28 12:14:26 UTC) #40
commit-bot: I haz the power
4 years, 7 months ago (2016-05-01 22:01:19 UTC) #43
Message was sent while issue was closed.
Patchset 10 (id:??) landed as
https://crrev.com/6b470a9413d2e65dd9078a63ed3f5f60e5ba5232
Cr-Commit-Position: refs/heads/master@{#12546}

Powered by Google App Engine
This is Rietveld 408576698