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

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

Issue 1898383003: RTCCertificate serialization. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Rebase with master (std::unique_ptr) Created 4 years, 7 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') | webrtc/base/sslidentity_unittest.cc » ('j') | 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 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 SSLIdentity* SSLIdentity::GenerateForTest(const SSLIdentityParams& params) { 180 SSLIdentity* SSLIdentity::GenerateForTest(const SSLIdentityParams& params) {
181 return OpenSSLIdentity::GenerateForTest(params); 181 return OpenSSLIdentity::GenerateForTest(params);
182 } 182 }
183 183
184 // static 184 // static
185 SSLIdentity* SSLIdentity::FromPEMStrings(const std::string& private_key, 185 SSLIdentity* SSLIdentity::FromPEMStrings(const std::string& private_key,
186 const std::string& certificate) { 186 const std::string& certificate) {
187 return OpenSSLIdentity::FromPEMStrings(private_key, certificate); 187 return OpenSSLIdentity::FromPEMStrings(private_key, certificate);
188 } 188 }
189 189
190 bool operator==(const SSLIdentity& a, const SSLIdentity& b) {
191 return static_cast<const OpenSSLIdentity&>(a) ==
192 static_cast<const OpenSSLIdentity&>(b);
193 }
194 bool operator!=(const SSLIdentity& a, const SSLIdentity& b) {
195 return !(a == b);
196 }
197
190 #else // !SSL_USE_OPENSSL 198 #else // !SSL_USE_OPENSSL
191 199
192 #error "No SSL implementation" 200 #error "No SSL implementation"
193 201
194 #endif // SSL_USE_OPENSSL 202 #endif // SSL_USE_OPENSSL
195 203
196 // Read |n| bytes from ASN1 number string at *|pp| and return the numeric value. 204 // Read |n| bytes from ASN1 number string at *|pp| and return the numeric value.
197 // Update *|pp| and *|np| to reflect number of read bytes. 205 // Update *|pp| and *|np| to reflect number of read bytes.
198 static inline int ASN1ReadInt(const unsigned char** pp, size_t* np, size_t n) { 206 static inline int ASN1ReadInt(const unsigned char** pp, size_t* np, size_t n) {
199 const unsigned char* p = *pp; 207 const unsigned char* p = *pp;
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 265
258 if (bytes_left != 1) { 266 if (bytes_left != 1) {
259 // Now just Z should remain. Its existence was asserted above. 267 // Now just Z should remain. Its existence was asserted above.
260 return -1; 268 return -1;
261 } 269 }
262 270
263 return TmToSeconds(tm); 271 return TmToSeconds(tm);
264 } 272 }
265 273
266 } // namespace rtc 274 } // namespace rtc
OLDNEW
« no previous file with comments | « webrtc/base/sslidentity.h ('k') | webrtc/base/sslidentity_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698