OLD | NEW |
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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 } | 107 } |
108 | 108 |
109 // Helper function for deleting a vector of certificates. | 109 // Helper function for deleting a vector of certificates. |
110 static void DeleteCert(SSLCertificate* cert) { delete cert; } | 110 static void DeleteCert(SSLCertificate* cert) { delete cert; } |
111 | 111 |
112 std::vector<SSLCertificate*> certs_; | 112 std::vector<SSLCertificate*> certs_; |
113 | 113 |
114 RTC_DISALLOW_COPY_AND_ASSIGN(SSLCertChain); | 114 RTC_DISALLOW_COPY_AND_ASSIGN(SSLCertChain); |
115 }; | 115 }; |
116 | 116 |
117 // KT_DEFAULT is currently an alias for KT_RSA. This is likely to change. | |
118 // KT_LAST is intended for vector declarations and loops over all key types; | 117 // KT_LAST is intended for vector declarations and loops over all key types; |
119 // it does not represent any key type in itself. | 118 // it does not represent any key type in itself. |
120 enum KeyType { KT_RSA, KT_ECDSA, KT_LAST, KT_DEFAULT = KT_RSA }; | 119 // KT_DEFAULT is used as the default KeyType for KeyParams. |
| 120 enum KeyType { |
| 121 KT_RSA, KT_ECDSA, KT_LAST, |
| 122 #if defined(WEBRTC_BUILD_CHROMIUM) |
| 123 // TODO(hbos): Because of an experiment running in Chromium which relies on |
| 124 // RSA being the default (for performance reasons) we have this #if. ECDSA |
| 125 // launches in Chromium by flipping a flag which overrides the default. As |
| 126 // soon as the experiment has ended and there is no risk of RSA being the |
| 127 // default we should make KT_DEFAULT = KT_ECDSA unconditionally. |
| 128 // crbug.com/611698 |
| 129 KT_DEFAULT = KT_RSA |
| 130 #else |
| 131 KT_DEFAULT = KT_ECDSA |
| 132 #endif |
| 133 }; |
121 | 134 |
122 static const int kRsaDefaultModSize = 1024; | 135 static const int kRsaDefaultModSize = 1024; |
123 static const int kRsaDefaultExponent = 0x10001; // = 2^16+1 = 65537 | 136 static const int kRsaDefaultExponent = 0x10001; // = 2^16+1 = 65537 |
124 static const int kRsaMinModSize = 1024; | 137 static const int kRsaMinModSize = 1024; |
125 static const int kRsaMaxModSize = 8192; | 138 static const int kRsaMaxModSize = 8192; |
126 | 139 |
127 // Certificate default validity lifetime. | 140 // Certificate default validity lifetime. |
128 static const int kDefaultCertificateLifetimeInSeconds = | 141 static const int kDefaultCertificateLifetimeInSeconds = |
129 60 * 60 * 24 * 30; // 30 days | 142 60 * 60 * 24 * 30; // 30 days |
130 // Certificate validity window. | 143 // Certificate validity window. |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 // |s| is not 0-terminated; its char count is defined by |length|. | 257 // |s| is not 0-terminated; its char count is defined by |length|. |
245 int64_t ASN1TimeToSec(const unsigned char* s, size_t length, bool long_format); | 258 int64_t ASN1TimeToSec(const unsigned char* s, size_t length, bool long_format); |
246 | 259 |
247 extern const char kPemTypeCertificate[]; | 260 extern const char kPemTypeCertificate[]; |
248 extern const char kPemTypeRsaPrivateKey[]; | 261 extern const char kPemTypeRsaPrivateKey[]; |
249 extern const char kPemTypeEcPrivateKey[]; | 262 extern const char kPemTypeEcPrivateKey[]; |
250 | 263 |
251 } // namespace rtc | 264 } // namespace rtc |
252 | 265 |
253 #endif // WEBRTC_BASE_SSLIDENTITY_H_ | 266 #endif // WEBRTC_BASE_SSLIDENTITY_H_ |
OLD | NEW |