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

Side by Side Diff: webrtc/base/opensslidentity.h

Issue 1683193003: Implement certificate lifetime parameter as required by WebRTC RFC. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Address feedback Created 4 years, 10 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 unified diff | Download patch
« no previous file with comments | « no previous file | webrtc/base/opensslidentity.cc » ('j') | webrtc/base/opensslidentity.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 X509* x509_; 95 X509* x509_;
96 96
97 RTC_DISALLOW_COPY_AND_ASSIGN(OpenSSLCertificate); 97 RTC_DISALLOW_COPY_AND_ASSIGN(OpenSSLCertificate);
98 }; 98 };
99 99
100 // Holds a keypair and certificate together, and a method to generate 100 // Holds a keypair and certificate together, and a method to generate
101 // them consistently. 101 // them consistently.
102 class OpenSSLIdentity : public SSLIdentity { 102 class OpenSSLIdentity : public SSLIdentity {
103 public: 103 public:
104 static OpenSSLIdentity* Generate(const std::string& common_name, 104 static OpenSSLIdentity* Generate(const std::string& common_name,
105 const KeyParams& key_params); 105 const KeyParams& key_params,
106 time_t certificate_lifetime);
Ryan Sleevi 2016/03/08 17:04:43 I would strongly advise against using time_t in a
torbjorng (webrtc) 2016/03/30 14:00:29 Note that Open/BoringSSL uses time_t, and this is
Ryan Sleevi 2016/03/31 02:07:53 OpenSSL's API is actually designed around the ASN1
torbjorng (webrtc) 2016/03/31 13:18:34 Right, I wasn't aware of that one set of interface
106 static OpenSSLIdentity* GenerateForTest(const SSLIdentityParams& params); 107 static OpenSSLIdentity* GenerateForTest(const SSLIdentityParams& params);
107 static SSLIdentity* FromPEMStrings(const std::string& private_key, 108 static SSLIdentity* FromPEMStrings(const std::string& private_key,
108 const std::string& certificate); 109 const std::string& certificate);
109 ~OpenSSLIdentity() override; 110 ~OpenSSLIdentity() override;
110 111
111 const OpenSSLCertificate& certificate() const override; 112 const OpenSSLCertificate& certificate() const override;
112 OpenSSLIdentity* GetReference() const override; 113 OpenSSLIdentity* GetReference() const override;
113 114
114 // Configure an SSL context object to use our key and certificate. 115 // Configure an SSL context object to use our key and certificate.
115 bool ConfigureIdentity(SSL_CTX* ctx); 116 bool ConfigureIdentity(SSL_CTX* ctx);
116 117
117 private: 118 private:
118 OpenSSLIdentity(OpenSSLKeyPair* key_pair, OpenSSLCertificate* certificate); 119 OpenSSLIdentity(OpenSSLKeyPair* key_pair, OpenSSLCertificate* certificate);
119 120
120 static OpenSSLIdentity* GenerateInternal(const SSLIdentityParams& params); 121 static OpenSSLIdentity* GenerateInternal(const SSLIdentityParams& params);
121 122
122 scoped_ptr<OpenSSLKeyPair> key_pair_; 123 scoped_ptr<OpenSSLKeyPair> key_pair_;
123 scoped_ptr<OpenSSLCertificate> certificate_; 124 scoped_ptr<OpenSSLCertificate> certificate_;
124 125
125 RTC_DISALLOW_COPY_AND_ASSIGN(OpenSSLIdentity); 126 RTC_DISALLOW_COPY_AND_ASSIGN(OpenSSLIdentity);
126 }; 127 };
127 128
128 129
129 } // namespace rtc 130 } // namespace rtc
130 131
131 #endif // WEBRTC_BASE_OPENSSLIDENTITY_H_ 132 #endif // WEBRTC_BASE_OPENSSLIDENTITY_H_
OLDNEW
« no previous file with comments | « no previous file | webrtc/base/opensslidentity.cc » ('j') | webrtc/base/opensslidentity.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698