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 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
296 usage_mask); | 296 usage_mask); |
297 | 297 |
298 return Status::Success(); | 298 return Status::Success(); |
299 } | 299 } |
300 | 300 |
301 Status GenerateRsaKeyPair(const blink::WebCryptoAlgorithm& algorithm, | 301 Status GenerateRsaKeyPair(const blink::WebCryptoAlgorithm& algorithm, |
302 bool extractable, | 302 bool extractable, |
303 blink::WebCryptoKeyUsageMask usage_mask, | 303 blink::WebCryptoKeyUsageMask usage_mask, |
304 unsigned int modulus_length_bits, | 304 unsigned int modulus_length_bits, |
305 const CryptoData& public_exponent, | 305 const CryptoData& public_exponent, |
306 const blink::WebCryptoAlgorithm& hash, | |
307 blink::WebCryptoKey* public_key, | 306 blink::WebCryptoKey* public_key, |
308 blink::WebCryptoKey* private_key) { | 307 blink::WebCryptoKey* private_key) { |
309 // TODO(padolph): Placeholder for OpenSSL implementation. | 308 // TODO(padolph): Placeholder for OpenSSL implementation. |
310 // Issue http://crbug.com/267888. | 309 // Issue http://crbug.com/267888. |
311 return Status::ErrorUnsupported(); | 310 return Status::ErrorUnsupported(); |
312 } | 311 } |
313 | 312 |
314 Status ImportKeyRaw(const blink::WebCryptoAlgorithm& algorithm, | 313 Status ImportKeyRaw(const blink::WebCryptoAlgorithm& algorithm, |
315 const CryptoData& key_data, | 314 const CryptoData& key_data, |
316 bool extractable, | 315 bool extractable, |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
401 SymKey* key, | 400 SymKey* key, |
402 const CryptoData& data, | 401 const CryptoData& data, |
403 const CryptoData& iv, | 402 const CryptoData& iv, |
404 const CryptoData& additional_data, | 403 const CryptoData& additional_data, |
405 unsigned int tag_length_bits, | 404 unsigned int tag_length_bits, |
406 std::vector<uint8>* buffer) { | 405 std::vector<uint8>* buffer) { |
407 // TODO(eroman): http://crbug.com/267888 | 406 // TODO(eroman): http://crbug.com/267888 |
408 return Status::ErrorUnsupported(); | 407 return Status::ErrorUnsupported(); |
409 } | 408 } |
410 | 409 |
411 // Guaranteed that key is valid. | |
412 Status EncryptRsaEsPkcs1v1_5(PublicKey* key, | |
413 const CryptoData& data, | |
414 std::vector<uint8>* buffer) { | |
415 // TODO(eroman): http://crbug.com/267888 | |
416 return Status::ErrorUnsupported(); | |
417 } | |
418 | |
419 Status DecryptRsaEsPkcs1v1_5(PrivateKey* key, | |
420 const CryptoData& data, | |
421 std::vector<uint8>* buffer) { | |
422 // TODO(eroman): http://crbug.com/267888 | |
423 return Status::ErrorUnsupported(); | |
424 } | |
425 | |
426 Status EncryptRsaOaep(PublicKey* key, | 410 Status EncryptRsaOaep(PublicKey* key, |
427 const blink::WebCryptoAlgorithm& hash, | 411 const blink::WebCryptoAlgorithm& hash, |
428 const CryptoData& label, | 412 const CryptoData& label, |
429 const CryptoData& data, | 413 const CryptoData& data, |
430 std::vector<uint8>* buffer) { | 414 std::vector<uint8>* buffer) { |
431 // TODO(eroman): http://crbug.com/267888 | 415 // TODO(eroman): http://crbug.com/267888 |
432 return Status::ErrorUnsupported(); | 416 return Status::ErrorUnsupported(); |
433 } | 417 } |
434 | 418 |
435 Status DecryptRsaOaep(PrivateKey* key, | 419 Status DecryptRsaOaep(PrivateKey* key, |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
526 return Status::ErrorUnsupported(); | 510 return Status::ErrorUnsupported(); |
527 } | 511 } |
528 | 512 |
529 Status DecryptAesKw(SymKey* key, | 513 Status DecryptAesKw(SymKey* key, |
530 const CryptoData& data, | 514 const CryptoData& data, |
531 std::vector<uint8>* buffer) { | 515 std::vector<uint8>* buffer) { |
532 // TODO(eroman): http://crbug.com/267888 | 516 // TODO(eroman): http://crbug.com/267888 |
533 return Status::ErrorUnsupported(); | 517 return Status::ErrorUnsupported(); |
534 } | 518 } |
535 | 519 |
536 Status WrapSymKeyRsaEs(SymKey* key, | |
537 PublicKey* wrapping_key, | |
538 std::vector<uint8>* buffer) { | |
539 // TODO(eroman): http://crbug.com/267888 | |
540 return Status::ErrorUnsupported(); | |
541 } | |
542 | |
543 Status UnwrapSymKeyRsaEs(const CryptoData& wrapped_key_data, | |
544 PrivateKey* wrapping_key, | |
545 const blink::WebCryptoAlgorithm& algorithm, | |
546 bool extractable, | |
547 blink::WebCryptoKeyUsageMask usage_mask, | |
548 blink::WebCryptoKey* key) { | |
549 // TODO(eroman): http://crbug.com/267888 | |
550 return Status::ErrorUnsupported(); | |
551 } | |
552 | |
553 bool ThreadSafeDeserializeKeyForClone( | 520 bool ThreadSafeDeserializeKeyForClone( |
554 const blink::WebCryptoKeyAlgorithm& algorithm, | 521 const blink::WebCryptoKeyAlgorithm& algorithm, |
555 blink::WebCryptoKeyType type, | 522 blink::WebCryptoKeyType type, |
556 bool extractable, | 523 bool extractable, |
557 blink::WebCryptoKeyUsageMask usages, | 524 blink::WebCryptoKeyUsageMask usages, |
558 const CryptoData& key_data, | 525 const CryptoData& key_data, |
559 blink::WebCryptoKey* key) { | 526 blink::WebCryptoKey* key) { |
560 // TODO(eroman): http://crbug.com/267888 | 527 // TODO(eroman): http://crbug.com/267888 |
561 return false; | 528 return false; |
562 } | 529 } |
563 | 530 |
564 } // namespace platform | 531 } // namespace platform |
565 | 532 |
566 } // namespace webcrypto | 533 } // namespace webcrypto |
567 | 534 |
568 } // namespace content | 535 } // namespace content |
OLD | NEW |