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 "chrome/common/extensions/api/networking_private/networking_private_cry
pto.h" | 5 #include "chrome/common/extensions/api/networking_private/networking_private_cry
pto.h" |
6 | 6 |
7 #include <openssl/digest.h> | |
8 #include <openssl/evp.h> | |
9 #include <openssl/rsa.h> | |
10 #include <openssl/x509.h> | |
11 #include <stddef.h> | 7 #include <stddef.h> |
12 | 8 |
13 #include <memory> | 9 #include <memory> |
14 | 10 |
15 #include "base/logging.h" | 11 #include "base/logging.h" |
16 #include "base/strings/string_util.h" | 12 #include "base/strings/string_util.h" |
17 #include "components/cast_certificate/cast_cert_validator.h" | 13 #include "components/cast_certificate/cast_cert_validator.h" |
18 #include "crypto/openssl_util.h" | 14 #include "crypto/openssl_util.h" |
19 #include "crypto/rsa_private_key.h" | 15 #include "crypto/rsa_private_key.h" |
20 #include "net/cert/pem_tokenizer.h" | 16 #include "net/cert/pem_tokenizer.h" |
| 17 #include "third_party/boringssl/src/include/openssl/digest.h" |
| 18 #include "third_party/boringssl/src/include/openssl/evp.h" |
| 19 #include "third_party/boringssl/src/include/openssl/rsa.h" |
| 20 #include "third_party/boringssl/src/include/openssl/x509.h" |
21 | 21 |
22 namespace { | 22 namespace { |
23 | 23 |
24 namespace cast_crypto = ::cast_certificate; | 24 namespace cast_crypto = ::cast_certificate; |
25 | 25 |
26 // Parses |pem_data| for a PEM block of |pem_type|. | 26 // Parses |pem_data| for a PEM block of |pem_type|. |
27 // Returns true if a |pem_type| block is found, storing the decoded result in | 27 // Returns true if a |pem_type| block is found, storing the decoded result in |
28 // |der_output|. | 28 // |der_output|. |
29 bool GetDERFromPEM(const std::string& pem_data, | 29 bool GetDERFromPEM(const std::string& pem_data, |
30 const std::string& pem_type, | 30 const std::string& pem_type, |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 rsa, RSA_PKCS1_PADDING); | 178 rsa, RSA_PKCS1_PADDING); |
179 if (output_length < 0) { | 179 if (output_length < 0) { |
180 LOG(ERROR) << "Error during decryption."; | 180 LOG(ERROR) << "Error during decryption."; |
181 return false; | 181 return false; |
182 } | 182 } |
183 decrypted_output->resize(output_length); | 183 decrypted_output->resize(output_length); |
184 return true; | 184 return true; |
185 } | 185 } |
186 | 186 |
187 } // namespace networking_private_crypto | 187 } // namespace networking_private_crypto |
OLD | NEW |