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/cert/cert_verify_proc_mac.h" | 5 #include "net/cert/cert_verify_proc_mac.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 | 10 |
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
375 | 375 |
376 CSSM_DATA cert_data; | 376 CSSM_DATA cert_data; |
377 OSStatus err = SecCertificateGetData(cert, &cert_data); | 377 OSStatus err = SecCertificateGetData(cert, &cert_data); |
378 DCHECK_EQ(err, noErr); | 378 DCHECK_EQ(err, noErr); |
379 base::StringPiece der_bytes(reinterpret_cast<const char*>(cert_data.Data), | 379 base::StringPiece der_bytes(reinterpret_cast<const char*>(cert_data.Data), |
380 cert_data.Length); | 380 cert_data.Length); |
381 base::StringPiece spki_bytes; | 381 base::StringPiece spki_bytes; |
382 if (!asn1::ExtractSPKIFromDERCert(der_bytes, &spki_bytes)) | 382 if (!asn1::ExtractSPKIFromDERCert(der_bytes, &spki_bytes)) |
383 continue; | 383 continue; |
384 | 384 |
385 HashValue sha1(HASH_VALUE_SHA1); | |
386 CC_SHA1(spki_bytes.data(), spki_bytes.size(), sha1.data()); | |
387 hashes->push_back(sha1); | |
388 | |
389 HashValue sha256(HASH_VALUE_SHA256); | 385 HashValue sha256(HASH_VALUE_SHA256); |
390 CC_SHA256(spki_bytes.data(), spki_bytes.size(), sha256.data()); | 386 CC_SHA256(spki_bytes.data(), spki_bytes.size(), sha256.data()); |
391 hashes->push_back(sha256); | 387 hashes->push_back(sha256); |
392 } | 388 } |
393 } | 389 } |
394 | 390 |
395 enum CRLSetResult { | 391 enum CRLSetResult { |
396 kCRLSetOk, | 392 kCRLSetOk, |
397 kCRLSetRevoked, | 393 kCRLSetRevoked, |
398 kCRLSetUnknown, | 394 kCRLSetUnknown, |
(...skipping 643 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1042 // EV cert and it was covered by CRLSets or revocation checking passed. | 1038 // EV cert and it was covered by CRLSets or revocation checking passed. |
1043 verify_result->cert_status |= CERT_STATUS_IS_EV; | 1039 verify_result->cert_status |= CERT_STATUS_IS_EV; |
1044 } | 1040 } |
1045 | 1041 |
1046 return OK; | 1042 return OK; |
1047 } | 1043 } |
1048 | 1044 |
1049 } // namespace net | 1045 } // namespace net |
1050 | 1046 |
1051 #pragma clang diagnostic pop // "-Wdeprecated-declarations" | 1047 #pragma clang diagnostic pop // "-Wdeprecated-declarations" |
OLD | NEW |