| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "net/base/x509_certificate.h" | 5 #include "net/base/x509_certificate.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "net/android/network_library.h" | 8 #include "net/android/network_library.h" |
| 9 #include "net/base/cert_status_flags.h" | 9 #include "net/base/cert_status_flags.h" |
| 10 #include "net/base/cert_verify_result.h" | 10 #include "net/base/cert_verify_result.h" |
| 11 #include "net/base/net_errors.h" | 11 #include "net/base/net_errors.h" |
| 12 | 12 |
| 13 namespace net { | 13 namespace net { |
| 14 | 14 |
| 15 int X509Certificate::VerifyInternal(const std::string& hostname, | 15 int X509Certificate::VerifyInternal(const std::string& hostname, |
| 16 int flags, | 16 int flags, |
| 17 CRLSet* crl_set, |
| 17 CertVerifyResult* verify_result) const { | 18 CertVerifyResult* verify_result) const { |
| 18 if (!VerifyNameMatch(hostname)) | 19 if (!VerifyNameMatch(hostname)) |
| 19 verify_result->cert_status |= CERT_STATUS_COMMON_NAME_INVALID; | 20 verify_result->cert_status |= CERT_STATUS_COMMON_NAME_INVALID; |
| 20 | 21 |
| 21 std::vector<std::string> cert_bytes; | 22 std::vector<std::string> cert_bytes; |
| 22 GetChainDEREncodedBytes(&cert_bytes); | 23 GetChainDEREncodedBytes(&cert_bytes); |
| 23 | 24 |
| 24 // TODO(joth): Fetch the authentication type from SSL rather than hardcode. | 25 // TODO(joth): Fetch the authentication type from SSL rather than hardcode. |
| 25 android::VerifyResult result = | 26 android::VerifyResult result = |
| 26 android::VerifyX509CertChain(cert_bytes, hostname, "RSA"); | 27 android::VerifyX509CertChain(cert_bytes, hostname, "RSA"); |
| (...skipping 27 matching lines...) Expand all Loading... |
| 54 it != cert_handles.end(); ++it) { | 55 it != cert_handles.end(); ++it) { |
| 55 DERCache der_cache = {0}; | 56 DERCache der_cache = {0}; |
| 56 GetDERAndCacheIfNeeded(*it, &der_cache); | 57 GetDERAndCacheIfNeeded(*it, &der_cache); |
| 57 std::string cert_bytes ( | 58 std::string cert_bytes ( |
| 58 reinterpret_cast<const char*>(der_cache.data), der_cache.data_length); | 59 reinterpret_cast<const char*>(der_cache.data), der_cache.data_length); |
| 59 chain_bytes->push_back(cert_bytes); | 60 chain_bytes->push_back(cert_bytes); |
| 60 } | 61 } |
| 61 } | 62 } |
| 62 | 63 |
| 63 } // namespace net | 64 } // namespace net |
| OLD | NEW |