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

Side by Side Diff: webrtc/base/sslidentity.cc

Issue 1701953002: Move SSLIdentity Generate() implementations from .h to .cc file. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Annotate static functions 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 | « webrtc/base/sslidentity.h ('k') | no next file » | no next file with comments »
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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 SSLCertChain::SSLCertChain(const SSLCertificate* cert) { 147 SSLCertChain::SSLCertChain(const SSLCertificate* cert) {
148 certs_.push_back(cert->GetReference()); 148 certs_.push_back(cert->GetReference());
149 } 149 }
150 150
151 SSLCertChain::~SSLCertChain() { 151 SSLCertChain::~SSLCertChain() {
152 std::for_each(certs_.begin(), certs_.end(), DeleteCert); 152 std::for_each(certs_.begin(), certs_.end(), DeleteCert);
153 } 153 }
154 154
155 #if SSL_USE_OPENSSL 155 #if SSL_USE_OPENSSL
156 156
157 // static
157 SSLCertificate* SSLCertificate::FromPEMString(const std::string& pem_string) { 158 SSLCertificate* SSLCertificate::FromPEMString(const std::string& pem_string) {
158 return OpenSSLCertificate::FromPEMString(pem_string); 159 return OpenSSLCertificate::FromPEMString(pem_string);
159 } 160 }
160 161
162 // static
161 SSLIdentity* SSLIdentity::Generate(const std::string& common_name, 163 SSLIdentity* SSLIdentity::Generate(const std::string& common_name,
162 const KeyParams& key_params, 164 const KeyParams& key_params,
163 time_t certificate_lifetime) { 165 time_t certificate_lifetime) {
164 return OpenSSLIdentity::Generate(common_name, key_params, 166 return OpenSSLIdentity::Generate(common_name, key_params,
165 certificate_lifetime); 167 certificate_lifetime);
166 } 168 }
167 169
170 // static
171 SSLIdentity* SSLIdentity::Generate(const std::string& common_name,
172 const KeyParams& key_params) {
173 return OpenSSLIdentity::Generate(common_name, key_params,
174 kDefaultCertificateLifetime);
175 }
176
177 // static
178 SSLIdentity* SSLIdentity::Generate(const std::string& common_name,
179 KeyType key_type) {
180 return OpenSSLIdentity::Generate(common_name, KeyParams(key_type),
181 kDefaultCertificateLifetime);
182 }
183
168 SSLIdentity* SSLIdentity::GenerateForTest(const SSLIdentityParams& params) { 184 SSLIdentity* SSLIdentity::GenerateForTest(const SSLIdentityParams& params) {
169 return OpenSSLIdentity::GenerateForTest(params); 185 return OpenSSLIdentity::GenerateForTest(params);
170 } 186 }
171 187
188 // static
172 SSLIdentity* SSLIdentity::FromPEMStrings(const std::string& private_key, 189 SSLIdentity* SSLIdentity::FromPEMStrings(const std::string& private_key,
173 const std::string& certificate) { 190 const std::string& certificate) {
174 return OpenSSLIdentity::FromPEMStrings(private_key, certificate); 191 return OpenSSLIdentity::FromPEMStrings(private_key, certificate);
175 } 192 }
176 193
177 #else // !SSL_USE_OPENSSL 194 #else // !SSL_USE_OPENSSL
178 195
179 #error "No SSL implementation" 196 #error "No SSL implementation"
180 197
181 #endif // SSL_USE_OPENSSL 198 #endif // SSL_USE_OPENSSL
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 261
245 if (bytes_left != 1) { 262 if (bytes_left != 1) {
246 // Now just Z should remain. Its existence was asserted above. 263 // Now just Z should remain. Its existence was asserted above.
247 return -1; 264 return -1;
248 } 265 }
249 266
250 return TmToSeconds(tm); 267 return TmToSeconds(tm);
251 } 268 }
252 269
253 } // namespace rtc 270 } // namespace rtc
OLDNEW
« no previous file with comments | « webrtc/base/sslidentity.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698