OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/child/webcrypto/platform_crypto.h" | 5 #include "content/child/webcrypto/platform_crypto.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 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
374 bool extractable, | 374 bool extractable, |
375 blink::WebCryptoKeyUsageMask usage_mask, | 375 blink::WebCryptoKeyUsageMask usage_mask, |
376 const CryptoData& modulus_data, | 376 const CryptoData& modulus_data, |
377 const CryptoData& exponent_data, | 377 const CryptoData& exponent_data, |
378 blink::WebCryptoKey* key) { | 378 blink::WebCryptoKey* key) { |
379 // TODO(padolph): Placeholder for OpenSSL implementation. | 379 // TODO(padolph): Placeholder for OpenSSL implementation. |
380 // Issue | 380 // Issue |
381 return Status::ErrorUnsupported(); | 381 return Status::ErrorUnsupported(); |
382 } | 382 } |
383 | 383 |
| 384 Status ImportRsaPrivateKey(const blink::WebCryptoAlgorithm& algorithm, |
| 385 bool extractable, |
| 386 blink::WebCryptoKeyUsageMask usage_mask, |
| 387 const CryptoData& modulus, |
| 388 const CryptoData& public_exponent, |
| 389 const CryptoData& private_exponent, |
| 390 const CryptoData& prime1, |
| 391 const CryptoData& prime2, |
| 392 const CryptoData& exponent1, |
| 393 const CryptoData& exponent2, |
| 394 const CryptoData& coefficient, |
| 395 blink::WebCryptoKey* key); |
| 396 |
384 Status EncryptDecryptAesGcm(EncryptOrDecrypt mode, | 397 Status EncryptDecryptAesGcm(EncryptOrDecrypt mode, |
385 SymKey* key, | 398 SymKey* key, |
386 const CryptoData& data, | 399 const CryptoData& data, |
387 const CryptoData& iv, | 400 const CryptoData& iv, |
388 const CryptoData& additional_data, | 401 const CryptoData& additional_data, |
389 unsigned int tag_length_bits, | 402 unsigned int tag_length_bits, |
390 std::vector<uint8>* buffer) { | 403 std::vector<uint8>* buffer) { |
391 // TODO(eroman): http://crbug.com/267888 | 404 // TODO(eroman): http://crbug.com/267888 |
392 return Status::ErrorUnsupported(); | 405 return Status::ErrorUnsupported(); |
393 } | 406 } |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
455 return Status::ErrorUnsupported(); | 468 return Status::ErrorUnsupported(); |
456 } | 469 } |
457 | 470 |
458 Status ExportRsaPublicKey(PublicKey* key, | 471 Status ExportRsaPublicKey(PublicKey* key, |
459 std::vector<uint8>* modulus, | 472 std::vector<uint8>* modulus, |
460 std::vector<uint8>* public_exponent) { | 473 std::vector<uint8>* public_exponent) { |
461 // TODO(eroman): http://crbug.com/267888 | 474 // TODO(eroman): http://crbug.com/267888 |
462 return Status::ErrorUnsupported(); | 475 return Status::ErrorUnsupported(); |
463 } | 476 } |
464 | 477 |
| 478 Status ExportRsaPrivateKey(PrivateKey* key, |
| 479 std::vector<uint8>* modulus, |
| 480 std::vector<uint8>* public_exponent, |
| 481 std::vector<uint8>* private_exponent, |
| 482 std::vector<uint8>* prime1, |
| 483 std::vector<uint8>* prime2, |
| 484 std::vector<uint8>* exponent1, |
| 485 std::vector<uint8>* exponent2, |
| 486 std::vector<uint8>* coefficient) { |
| 487 // TODO(eroman): http://crbug.com/267888 |
| 488 return Status::ErrorUnsupported(); |
| 489 } |
| 490 |
465 Status WrapSymKeyAesKw(SymKey* key, | 491 Status WrapSymKeyAesKw(SymKey* key, |
466 SymKey* wrapping_key, | 492 SymKey* wrapping_key, |
467 std::vector<uint8>* buffer) { | 493 std::vector<uint8>* buffer) { |
468 // TODO(eroman): http://crbug.com/267888 | 494 // TODO(eroman): http://crbug.com/267888 |
469 return Status::ErrorUnsupported(); | 495 return Status::ErrorUnsupported(); |
470 } | 496 } |
471 | 497 |
472 Status UnwrapSymKeyAesKw(const CryptoData& wrapped_key_data, | 498 Status UnwrapSymKeyAesKw(const CryptoData& wrapped_key_data, |
473 SymKey* wrapping_key, | 499 SymKey* wrapping_key, |
474 const blink::WebCryptoAlgorithm& algorithm, | 500 const blink::WebCryptoAlgorithm& algorithm, |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
512 blink::WebCryptoKey* key) { | 538 blink::WebCryptoKey* key) { |
513 // TODO(eroman): http://crbug.com/267888 | 539 // TODO(eroman): http://crbug.com/267888 |
514 return false; | 540 return false; |
515 } | 541 } |
516 | 542 |
517 } // namespace platform | 543 } // namespace platform |
518 | 544 |
519 } // namespace webcrypto | 545 } // namespace webcrypto |
520 | 546 |
521 } // namespace content | 547 } // namespace content |
OLD | NEW |