| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/cert_verify_proc_android.h" | 5 #include "net/base/cert_verify_proc_android.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 std::vector<std::string> cert_bytes; | 81 std::vector<std::string> cert_bytes; |
| 82 if (!GetChainDEREncodedBytes(cert, &cert_bytes)) | 82 if (!GetChainDEREncodedBytes(cert, &cert_bytes)) |
| 83 return ERR_CERT_INVALID; | 83 return ERR_CERT_INVALID; |
| 84 if (!VerifyFromAndroidTrustManager(cert_bytes, verify_result)) { | 84 if (!VerifyFromAndroidTrustManager(cert_bytes, verify_result)) { |
| 85 NOTREACHED(); | 85 NOTREACHED(); |
| 86 return ERR_FAILED; | 86 return ERR_FAILED; |
| 87 } | 87 } |
| 88 if (IsCertStatusError(verify_result->cert_status)) | 88 if (IsCertStatusError(verify_result->cert_status)) |
| 89 return MapCertStatusToNetError(verify_result->cert_status); | 89 return MapCertStatusToNetError(verify_result->cert_status); |
| 90 | 90 |
| 91 // TODO(ppi): Implement missing functionality: yielding the constructed trust |
| 92 // chain, public key hashes of its certificates and |is_issued_by_known_root| |
| 93 // flag. All of the above require specific support from the platform, missing |
| 94 // in the Java APIs. See also: http://crbug.com/116838 |
| 95 |
| 96 // Until the required support is available in the platform, we don't know if |
| 97 // the trust root at the end of the chain was standard or user-added, so we |
| 98 // mark all correctly verified certificates as issued by a known root. |
| 99 verify_result->is_issued_by_known_root = true; |
| 100 |
| 91 return OK; | 101 return OK; |
| 92 } | 102 } |
| 93 | 103 |
| 94 } // namespace net | 104 } // namespace net |
| OLD | NEW |