Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(518)

Side by Side Diff: net/base/x509_certificate_mac.cc

Issue 7969023: For the SSL cert status, convert anonymous enum that gives bit values into a typedefed uint32. Th... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/base/ssl_info.h ('k') | net/base/x509_certificate_nss.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 case errSecNoPolicyModule: 49 case errSecNoPolicyModule:
50 return ERR_NOT_IMPLEMENTED; 50 return ERR_NOT_IMPLEMENTED;
51 case errSecAuthFailed: 51 case errSecAuthFailed:
52 return ERR_ACCESS_DENIED; 52 return ERR_ACCESS_DENIED;
53 default: 53 default:
54 LOG(ERROR) << "Unknown error " << status << " mapped to ERR_FAILED"; 54 LOG(ERROR) << "Unknown error " << status << " mapped to ERR_FAILED";
55 return ERR_FAILED; 55 return ERR_FAILED;
56 } 56 }
57 } 57 }
58 58
59 int CertStatusFromOSStatus(OSStatus status) { 59 CertStatus CertStatusFromOSStatus(OSStatus status) {
60 switch (status) { 60 switch (status) {
61 case noErr: 61 case noErr:
62 return 0; 62 return 0;
63 63
64 case CSSMERR_TP_INVALID_ANCHOR_CERT: 64 case CSSMERR_TP_INVALID_ANCHOR_CERT:
65 case CSSMERR_TP_NOT_TRUSTED: 65 case CSSMERR_TP_NOT_TRUSTED:
66 case CSSMERR_TP_INVALID_CERT_AUTHORITY: 66 case CSSMERR_TP_INVALID_CERT_AUTHORITY:
67 return CERT_STATUS_AUTHORITY_INVALID; 67 return CERT_STATUS_AUTHORITY_INVALID;
68 68
69 case CSSMERR_TP_CERT_EXPIRED: 69 case CSSMERR_TP_CERT_EXPIRED:
(...skipping 1288 matching lines...) Expand 10 before | Expand all | Expand 10 after
1358 CSSM_DATA cert_data; 1358 CSSM_DATA cert_data;
1359 OSStatus status = SecCertificateGetData(cert_handle, &cert_data); 1359 OSStatus status = SecCertificateGetData(cert_handle, &cert_data);
1360 if (status) 1360 if (status)
1361 return false; 1361 return false;
1362 1362
1363 return pickle->WriteData(reinterpret_cast<char*>(cert_data.Data), 1363 return pickle->WriteData(reinterpret_cast<char*>(cert_data.Data),
1364 cert_data.Length); 1364 cert_data.Length);
1365 } 1365 }
1366 1366
1367 } // namespace net 1367 } // namespace net
OLDNEW
« no previous file with comments | « net/base/ssl_info.h ('k') | net/base/x509_certificate_nss.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698