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

Side by Side Diff: content/renderer/webcrypto/webcrypto_impl_openssl.cc

Issue 34583010: [webcrypto] Add RSA key generation using NSS. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: (minor) fixes for eroman Created 7 years, 1 month 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 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/webcrypto/webcrypto_impl.h" 5 #include "content/renderer/webcrypto/webcrypto_impl.h"
6 6
7 #include <vector> 7 #include <vector>
8 #include <openssl/aes.h> 8 #include <openssl/aes.h>
9 #include <openssl/evp.h> 9 #include <openssl/evp.h>
10 #include <openssl/hmac.h> 10 #include <openssl/hmac.h>
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 return false; 292 return false;
293 } 293 }
294 294
295 *key = WebKit::WebCryptoKey::create( 295 *key = WebKit::WebCryptoKey::create(
296 new SymKeyHandle(&random_bytes[0], random_bytes.size()), 296 new SymKeyHandle(&random_bytes[0], random_bytes.size()),
297 key_type, extractable, algorithm, usage_mask); 297 key_type, extractable, algorithm, usage_mask);
298 298
299 return true; 299 return true;
300 } 300 }
301 301
302 bool WebCryptoImpl::GenerateKeyPairInternal(
303 const WebKit::WebCryptoAlgorithm& algorithm,
304 bool extractable,
305 WebKit::WebCryptoKeyUsageMask usage_mask,
306 WebKit::WebCryptoKey* public_key,
307 WebKit::WebCryptoKey* private_key) {
308 // TODO(padolph): Placeholder for OpenSSL implementation.
309 // Issue http://crbug.com/267888.
310 return false;
311 }
312
302 bool WebCryptoImpl::ImportKeyInternal( 313 bool WebCryptoImpl::ImportKeyInternal(
303 WebKit::WebCryptoKeyFormat format, 314 WebKit::WebCryptoKeyFormat format,
304 const unsigned char* key_data, 315 const unsigned char* key_data,
305 unsigned key_data_size, 316 unsigned key_data_size,
306 const WebKit::WebCryptoAlgorithm& algorithm_or_null, 317 const WebKit::WebCryptoAlgorithm& algorithm_or_null,
307 bool extractable, 318 bool extractable,
308 WebKit::WebCryptoKeyUsageMask usage_mask, 319 WebKit::WebCryptoKeyUsageMask usage_mask,
309 WebKit::WebCryptoKey* key) { 320 WebKit::WebCryptoKey* key) {
310 // TODO(eroman): Currently expects algorithm to always be specified, as it is 321 // TODO(eroman): Currently expects algorithm to always be specified, as it is
311 // required for raw format. 322 // required for raw format.
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
471 482
472 break; 483 break;
473 } 484 }
474 default: 485 default:
475 return false; 486 return false;
476 } 487 }
477 return true; 488 return true;
478 } 489 }
479 490
480 } // namespace content 491 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/webcrypto/webcrypto_impl_nss.cc ('k') | content/renderer/webcrypto/webcrypto_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698