Chromium Code Reviews| 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 // Android call does not provide information if the trust root at the end of | |
| 92 // the constructed chain was standard or user-added CA, so we mark all | |
| 93 // correctly verified certificates as issued by a known root. | |
| 94 verify_result->is_issued_by_known_root = true; | |
|
Ryan Sleevi
2012/12/14 18:22:07
blaaarghh
This will need to be a system API featu
ppi
2012/12/14 20:27:35
I edited the comment to mention the need of such s
joth
2012/12/14 20:30:01
A solution was discussed in b/5826113 (linked from
| |
| 95 | |
| 96 // TODO(ppi): Implement missing functionality of certificate verification: | |
| 97 // providing the constructed trust chain (along with public key hashes of its | |
| 98 // certificates). See also: crbug.com/116838 | |
|
Ryan Sleevi
2012/12/14 18:22:07
nit: http://-ify the link
ppi
2012/12/14 20:27:35
Thanks, fixed.
| |
| 91 return OK; | 99 return OK; |
| 92 } | 100 } |
| 93 | 101 |
| 94 } // namespace net | 102 } // namespace net |
| OLD | NEW |