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 // TODO(eroman): http://crbug.com/267888 |
| 397 return Status::ErrorUnsupported(); |
| 398 } |
| 399 |
384 Status EncryptDecryptAesGcm(EncryptOrDecrypt mode, | 400 Status EncryptDecryptAesGcm(EncryptOrDecrypt mode, |
385 SymKey* key, | 401 SymKey* key, |
386 const CryptoData& data, | 402 const CryptoData& data, |
387 const CryptoData& iv, | 403 const CryptoData& iv, |
388 const CryptoData& additional_data, | 404 const CryptoData& additional_data, |
389 unsigned int tag_length_bits, | 405 unsigned int tag_length_bits, |
390 std::vector<uint8>* buffer) { | 406 std::vector<uint8>* buffer) { |
391 // TODO(eroman): http://crbug.com/267888 | 407 // TODO(eroman): http://crbug.com/267888 |
392 return Status::ErrorUnsupported(); | 408 return Status::ErrorUnsupported(); |
393 } | 409 } |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
455 return Status::ErrorUnsupported(); | 471 return Status::ErrorUnsupported(); |
456 } | 472 } |
457 | 473 |
458 Status ExportRsaPublicKey(PublicKey* key, | 474 Status ExportRsaPublicKey(PublicKey* key, |
459 std::vector<uint8>* modulus, | 475 std::vector<uint8>* modulus, |
460 std::vector<uint8>* public_exponent) { | 476 std::vector<uint8>* public_exponent) { |
461 // TODO(eroman): http://crbug.com/267888 | 477 // TODO(eroman): http://crbug.com/267888 |
462 return Status::ErrorUnsupported(); | 478 return Status::ErrorUnsupported(); |
463 } | 479 } |
464 | 480 |
| 481 Status ExportRsaPrivateKey(PrivateKey* key, |
| 482 std::vector<uint8>* modulus, |
| 483 std::vector<uint8>* public_exponent, |
| 484 std::vector<uint8>* private_exponent, |
| 485 std::vector<uint8>* prime1, |
| 486 std::vector<uint8>* prime2, |
| 487 std::vector<uint8>* exponent1, |
| 488 std::vector<uint8>* exponent2, |
| 489 std::vector<uint8>* coefficient) { |
| 490 // TODO(eroman): http://crbug.com/267888 |
| 491 return Status::ErrorUnsupported(); |
| 492 } |
| 493 |
465 Status WrapSymKeyAesKw(SymKey* key, | 494 Status WrapSymKeyAesKw(SymKey* key, |
466 SymKey* wrapping_key, | 495 SymKey* wrapping_key, |
467 std::vector<uint8>* buffer) { | 496 std::vector<uint8>* buffer) { |
468 // TODO(eroman): http://crbug.com/267888 | 497 // TODO(eroman): http://crbug.com/267888 |
469 return Status::ErrorUnsupported(); | 498 return Status::ErrorUnsupported(); |
470 } | 499 } |
471 | 500 |
472 Status UnwrapSymKeyAesKw(const CryptoData& wrapped_key_data, | 501 Status UnwrapSymKeyAesKw(const CryptoData& wrapped_key_data, |
473 SymKey* wrapping_key, | 502 SymKey* wrapping_key, |
474 const blink::WebCryptoAlgorithm& algorithm, | 503 const blink::WebCryptoAlgorithm& algorithm, |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
512 blink::WebCryptoKey* key) { | 541 blink::WebCryptoKey* key) { |
513 // TODO(eroman): http://crbug.com/267888 | 542 // TODO(eroman): http://crbug.com/267888 |
514 return false; | 543 return false; |
515 } | 544 } |
516 | 545 |
517 } // namespace platform | 546 } // namespace platform |
518 | 547 |
519 } // namespace webcrypto | 548 } // namespace webcrypto |
520 | 549 |
521 } // namespace content | 550 } // namespace content |
OLD | NEW |