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