| OLD | NEW |
| 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 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 if (!(RAND_bytes(&random_bytes[0], keylen_bytes))) { | 290 if (!(RAND_bytes(&random_bytes[0], keylen_bytes))) { |
| 291 return false; | 291 return false; |
| 292 } | 292 } |
| 293 | 293 |
| 294 key->reset(new SymKeyHandle(&random_bytes[0], random_bytes.size())); | 294 key->reset(new SymKeyHandle(&random_bytes[0], random_bytes.size())); |
| 295 *type = key_type; | 295 *type = key_type; |
| 296 | 296 |
| 297 return true; | 297 return true; |
| 298 } | 298 } |
| 299 | 299 |
| 300 bool WebCryptoImpl::GenerateKeyPairInternal( |
| 301 const WebKit::WebCryptoAlgorithm& algorithm, |
| 302 scoped_ptr<WebKit::WebCryptoKeyHandle>* public_key, |
| 303 scoped_ptr<WebKit::WebCryptoKeyHandle>* private_key) { |
| 304 // TODO(padolph): Placeholder for OpenSSL implementation. |
| 305 // Issue http://crbug.com/267888. |
| 306 return false; |
| 307 } |
| 308 |
| 300 bool WebCryptoImpl::ImportKeyInternal( | 309 bool WebCryptoImpl::ImportKeyInternal( |
| 301 WebKit::WebCryptoKeyFormat format, | 310 WebKit::WebCryptoKeyFormat format, |
| 302 const unsigned char* key_data, | 311 const unsigned char* key_data, |
| 303 unsigned key_data_size, | 312 unsigned key_data_size, |
| 304 const WebKit::WebCryptoAlgorithm& algorithm, | 313 const WebKit::WebCryptoAlgorithm& algorithm, |
| 305 WebKit::WebCryptoKeyUsageMask /*usage_mask*/, | 314 WebKit::WebCryptoKeyUsageMask /*usage_mask*/, |
| 306 scoped_ptr<WebKit::WebCryptoKeyHandle>* handle, | 315 scoped_ptr<WebKit::WebCryptoKeyHandle>* handle, |
| 307 WebKit::WebCryptoKeyType* type) { | 316 WebKit::WebCryptoKeyType* type) { |
| 308 | 317 |
| 309 // TODO(padolph): Support all relevant alg types and then remove this gate. | 318 // TODO(padolph): Support all relevant alg types and then remove this gate. |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 462 | 471 |
| 463 break; | 472 break; |
| 464 } | 473 } |
| 465 default: | 474 default: |
| 466 return false; | 475 return false; |
| 467 } | 476 } |
| 468 return true; | 477 return true; |
| 469 } | 478 } |
| 470 | 479 |
| 471 } // namespace content | 480 } // namespace content |
| OLD | NEW |