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

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

Issue 1189583002: Support generation of EC keys using P256 curve and support ECDSA certs. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: explicitly enable ECDSA for NSS; tolerate ECDSA and RSA certs in unittest Created 5 years, 5 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
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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 SSLCertChain::~SSLCertChain() { 101 SSLCertChain::~SSLCertChain() {
102 std::for_each(certs_.begin(), certs_.end(), DeleteCert); 102 std::for_each(certs_.begin(), certs_.end(), DeleteCert);
103 } 103 }
104 104
105 #if SSL_USE_SCHANNEL 105 #if SSL_USE_SCHANNEL
106 106
107 SSLCertificate* SSLCertificate::FromPEMString(const std::string& pem_string) { 107 SSLCertificate* SSLCertificate::FromPEMString(const std::string& pem_string) {
108 return NULL; 108 return NULL;
109 } 109 }
110 110
111 SSLIdentity* SSLIdentity::Generate(const std::string& common_name) { 111 SSLIdentity* SSLIdentity::Generate(const std::string& common_name,
112 KeyType key_type) {
112 return NULL; 113 return NULL;
113 } 114 }
114 115
115 SSLIdentity* GenerateForTest(const SSLIdentityParams& params) { 116 SSLIdentity* GenerateForTest(const SSLIdentityParams& params) {
116 return NULL; 117 return NULL;
117 } 118 }
118 119
119 SSLIdentity* SSLIdentity::FromPEMStrings(const std::string& private_key, 120 SSLIdentity* SSLIdentity::FromPEMStrings(const std::string& private_key,
120 const std::string& certificate) { 121 const std::string& certificate) {
121 return NULL; 122 return NULL;
122 } 123 }
123 124
124 #elif SSL_USE_OPENSSL // !SSL_USE_SCHANNEL 125 #elif SSL_USE_OPENSSL // !SSL_USE_SCHANNEL
125 126
126 SSLCertificate* SSLCertificate::FromPEMString(const std::string& pem_string) { 127 SSLCertificate* SSLCertificate::FromPEMString(const std::string& pem_string) {
127 return OpenSSLCertificate::FromPEMString(pem_string); 128 return OpenSSLCertificate::FromPEMString(pem_string);
128 } 129 }
129 130
130 SSLIdentity* SSLIdentity::Generate(const std::string& common_name) { 131 SSLIdentity* SSLIdentity::Generate(const std::string& common_name,
131 return OpenSSLIdentity::Generate(common_name); 132 KeyType key_type) {
133 return OpenSSLIdentity::Generate(common_name, key_type);
132 } 134 }
133 135
134 SSLIdentity* SSLIdentity::GenerateForTest(const SSLIdentityParams& params) { 136 SSLIdentity* SSLIdentity::GenerateForTest(const SSLIdentityParams& params,
135 return OpenSSLIdentity::GenerateForTest(params); 137 KeyType key_type) {
138 return OpenSSLIdentity::GenerateForTest(params, key_type);
136 } 139 }
137 140
138 SSLIdentity* SSLIdentity::FromPEMStrings(const std::string& private_key, 141 SSLIdentity* SSLIdentity::FromPEMStrings(const std::string& private_key,
139 const std::string& certificate) { 142 const std::string& certificate) {
140 return OpenSSLIdentity::FromPEMStrings(private_key, certificate); 143 return OpenSSLIdentity::FromPEMStrings(private_key, certificate);
141 } 144 }
142 145
143 #elif SSL_USE_NSS // !SSL_USE_OPENSSL && !SSL_USE_SCHANNEL 146 #elif SSL_USE_NSS // !SSL_USE_OPENSSL && !SSL_USE_SCHANNEL
144 147
145 SSLCertificate* SSLCertificate::FromPEMString(const std::string& pem_string) { 148 SSLCertificate* SSLCertificate::FromPEMString(const std::string& pem_string) {
146 return NSSCertificate::FromPEMString(pem_string); 149 return NSSCertificate::FromPEMString(pem_string);
147 } 150 }
148 151
149 SSLIdentity* SSLIdentity::Generate(const std::string& common_name) { 152 SSLIdentity* SSLIdentity::Generate(const std::string& common_name,
150 return NSSIdentity::Generate(common_name); 153 KeyType key_type) {
154 return NSSIdentity::Generate(common_name, key_type);
151 } 155 }
152 156
153 SSLIdentity* SSLIdentity::GenerateForTest(const SSLIdentityParams& params) { 157 SSLIdentity* SSLIdentity::GenerateForTest(const SSLIdentityParams& params,
154 return NSSIdentity::GenerateForTest(params); 158 KeyType key_type) {
juberti1 2015/06/26 19:16:01 I think it probably makes sense to put KeyType int
torbjorng (webrtc) 2015/07/02 12:35:07 Done.
159 return NSSIdentity::GenerateForTest(params, key_type);
155 } 160 }
156 161
157 SSLIdentity* SSLIdentity::FromPEMStrings(const std::string& private_key, 162 SSLIdentity* SSLIdentity::FromPEMStrings(const std::string& private_key,
158 const std::string& certificate) { 163 const std::string& certificate) {
159 return NSSIdentity::FromPEMStrings(private_key, certificate); 164 return NSSIdentity::FromPEMStrings(private_key, certificate);
160 } 165 }
161 166
162 #else // !SSL_USE_OPENSSL && !SSL_USE_SCHANNEL && !SSL_USE_NSS 167 #else // !SSL_USE_OPENSSL && !SSL_USE_SCHANNEL && !SSL_USE_NSS
163 168
164 #error "No SSL implementation" 169 #error "No SSL implementation"
165 170
166 #endif // SSL_USE_SCHANNEL 171 #endif // SSL_USE_SCHANNEL
167 172
168 } // namespace rtc 173 } // namespace rtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698