| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <CommonCrypto/CommonDigest.h> | 7 #include <CommonCrypto/CommonDigest.h> |
| 8 #include <CoreServices/CoreServices.h> | 8 #include <CoreServices/CoreServices.h> |
| 9 #include <Security/Security.h> | 9 #include <Security/Security.h> |
| 10 #include <time.h> | 10 #include <time.h> |
| (...skipping 1018 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1029 CFRelease(ev_dict); | 1029 CFRelease(ev_dict); |
| 1030 verify_result->cert_status |= CERT_STATUS_IS_EV; | 1030 verify_result->cert_status |= CERT_STATUS_IS_EV; |
| 1031 } | 1031 } |
| 1032 } | 1032 } |
| 1033 } | 1033 } |
| 1034 } | 1034 } |
| 1035 | 1035 |
| 1036 AppendPublicKeyHashes(completed_chain, &verify_result->public_key_hashes); | 1036 AppendPublicKeyHashes(completed_chain, &verify_result->public_key_hashes); |
| 1037 verify_result->is_issued_by_known_root = IsIssuedByKnownRoot(completed_chain); | 1037 verify_result->is_issued_by_known_root = IsIssuedByKnownRoot(completed_chain); |
| 1038 | 1038 |
| 1039 if (IsPublicKeyBlacklisted(verify_result->public_key_hashes)) { |
| 1040 verify_result->cert_status |= CERT_STATUS_AUTHORITY_INVALID; |
| 1041 return MapCertStatusToNetError(verify_result->cert_status); |
| 1042 } |
| 1043 |
| 1039 return OK; | 1044 return OK; |
| 1040 } | 1045 } |
| 1041 | 1046 |
| 1042 bool X509Certificate::GetDEREncoded(std::string* encoded) { | 1047 bool X509Certificate::GetDEREncoded(std::string* encoded) { |
| 1043 encoded->clear(); | 1048 encoded->clear(); |
| 1044 CSSM_DATA der_data; | 1049 CSSM_DATA der_data; |
| 1045 if(SecCertificateGetData(cert_handle_, &der_data) == noErr) { | 1050 if(SecCertificateGetData(cert_handle_, &der_data) == noErr) { |
| 1046 encoded->append(reinterpret_cast<char*>(der_data.Data), | 1051 encoded->append(reinterpret_cast<char*>(der_data.Data), |
| 1047 der_data.Length); | 1052 der_data.Length); |
| 1048 return true; | 1053 return true; |
| (...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1359 CSSM_DATA cert_data; | 1364 CSSM_DATA cert_data; |
| 1360 OSStatus status = SecCertificateGetData(cert_handle, &cert_data); | 1365 OSStatus status = SecCertificateGetData(cert_handle, &cert_data); |
| 1361 if (status) | 1366 if (status) |
| 1362 return false; | 1367 return false; |
| 1363 | 1368 |
| 1364 return pickle->WriteData(reinterpret_cast<char*>(cert_data.Data), | 1369 return pickle->WriteData(reinterpret_cast<char*>(cert_data.Data), |
| 1365 cert_data.Length); | 1370 cert_data.Length); |
| 1366 } | 1371 } |
| 1367 | 1372 |
| 1368 } // namespace net | 1373 } // namespace net |
| OLD | NEW |