| 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 "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
| 10 #include "extensions/common/cast/cast_cert_validator.h" | 10 #include "extensions/common/cast/cast_cert_validator.h" |
| 11 #include "net/cert/pem_tokenizer.h" | 11 #include "net/cert/pem_tokenizer.h" |
| 12 | 12 |
| 13 namespace { | 13 namespace { |
| 14 | 14 |
| 15 namespace cast_crypto = ::extensions::core_api::cast_crypto; | 15 namespace cast_crypto = ::extensions::api::cast_crypto; |
| 16 | 16 |
| 17 } // namespace | 17 } // namespace |
| 18 | 18 |
| 19 namespace networking_private_crypto { | 19 namespace networking_private_crypto { |
| 20 | 20 |
| 21 bool VerifyCredentials( | 21 bool VerifyCredentials( |
| 22 const std::string& certificate, | 22 const std::string& certificate, |
| 23 const std::vector<std::string>& intermediate_certificates, | 23 const std::vector<std::string>& intermediate_certificates, |
| 24 const std::string& signature, | 24 const std::string& signature, |
| 25 const std::string& data, | 25 const std::string& data, |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 verification_context->VerifySignatureOverData(signature, data); | 77 verification_context->VerifySignatureOverData(signature, data); |
| 78 | 78 |
| 79 if (verification_result.Failure()) { | 79 if (verification_result.Failure()) { |
| 80 LOG(ERROR) << kErrorPrefix << verification_result.GetLogString(); | 80 LOG(ERROR) << kErrorPrefix << verification_result.GetLogString(); |
| 81 return false; | 81 return false; |
| 82 } | 82 } |
| 83 return true; | 83 return true; |
| 84 } | 84 } |
| 85 | 85 |
| 86 } // namespace networking_private_crypto | 86 } // namespace networking_private_crypto |
| OLD | NEW |