| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "components/webcrypto/algorithms/asymmetric_key_util.h" | 5 #include "components/webcrypto/algorithms/asymmetric_key_util.h" |
| 6 | 6 |
| 7 #include <openssl/bytestring.h> | |
| 8 #include <openssl/evp.h> | |
| 9 #include <openssl/mem.h> | |
| 10 #include <stdint.h> | 7 #include <stdint.h> |
| 11 #include <utility> | 8 #include <utility> |
| 12 | 9 |
| 13 #include "components/webcrypto/algorithms/util.h" | 10 #include "components/webcrypto/algorithms/util.h" |
| 14 #include "components/webcrypto/blink_key_handle.h" | 11 #include "components/webcrypto/blink_key_handle.h" |
| 15 #include "components/webcrypto/crypto_data.h" | 12 #include "components/webcrypto/crypto_data.h" |
| 16 #include "components/webcrypto/generate_key_result.h" | 13 #include "components/webcrypto/generate_key_result.h" |
| 17 #include "components/webcrypto/status.h" | 14 #include "components/webcrypto/status.h" |
| 18 #include "crypto/openssl_util.h" | 15 #include "crypto/openssl_util.h" |
| 16 #include "third_party/boringssl/src/include/openssl/bytestring.h" |
| 17 #include "third_party/boringssl/src/include/openssl/evp.h" |
| 18 #include "third_party/boringssl/src/include/openssl/mem.h" |
| 19 | 19 |
| 20 namespace webcrypto { | 20 namespace webcrypto { |
| 21 | 21 |
| 22 namespace { | 22 namespace { |
| 23 | 23 |
| 24 // Exports an EVP_PKEY public key to the SPKI format. | 24 // Exports an EVP_PKEY public key to the SPKI format. |
| 25 Status ExportPKeySpki(EVP_PKEY* key, std::vector<uint8_t>* buffer) { | 25 Status ExportPKeySpki(EVP_PKEY* key, std::vector<uint8_t>* buffer) { |
| 26 crypto::OpenSSLErrStackTracer err_tracer(FROM_HERE); | 26 crypto::OpenSSLErrStackTracer err_tracer(FROM_HERE); |
| 27 | 27 |
| 28 uint8_t* der; | 28 uint8_t* der; |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 *public_usages = combined_usages & all_public_usages; | 144 *public_usages = combined_usages & all_public_usages; |
| 145 *private_usages = combined_usages & all_private_usages; | 145 *private_usages = combined_usages & all_private_usages; |
| 146 | 146 |
| 147 // NOTE: empty private_usages is allowed at this layer. Such keys will be | 147 // NOTE: empty private_usages is allowed at this layer. Such keys will be |
| 148 // rejected at a higher layer. | 148 // rejected at a higher layer. |
| 149 | 149 |
| 150 return Status::Success(); | 150 return Status::Success(); |
| 151 } | 151 } |
| 152 | 152 |
| 153 } // namespace webcrypto | 153 } // namespace webcrypto |
| OLD | NEW |