OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 #ifndef NET_BASE_CERT_STATUS_FLAGS_H_ | 5 #ifndef NET_BASE_CERT_STATUS_FLAGS_H_ |
6 #define NET_BASE_CERT_STATUS_FLAGS_H_ | 6 #define NET_BASE_CERT_STATUS_FLAGS_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 namespace net { | 9 namespace net { |
10 | 10 |
11 // Status flags, such as errors and extended validation. | 11 // Status flags, such as errors and extended validation. |
12 enum { | 12 enum CertStatusFlags { |
13 // Bits 0 to 15 are for errors. | 13 // Bits 0 to 15 are for errors. |
14 CERT_STATUS_ALL_ERRORS = 0xFFFF, | 14 CERT_STATUS_ALL_ERRORS = 0xFFFF, |
15 CERT_STATUS_COMMON_NAME_INVALID = 1 << 0, | 15 CERT_STATUS_COMMON_NAME_INVALID = 1 << 0, |
16 CERT_STATUS_DATE_INVALID = 1 << 1, | 16 CERT_STATUS_DATE_INVALID = 1 << 1, |
17 CERT_STATUS_AUTHORITY_INVALID = 1 << 2, | 17 CERT_STATUS_AUTHORITY_INVALID = 1 << 2, |
18 // 1 << 3 is reserved for ERR_CERT_CONTAINS_ERRORS (not useful with WinHTTP). | 18 // 1 << 3 is reserved for ERR_CERT_CONTAINS_ERRORS (not useful with WinHTTP). |
19 CERT_STATUS_NO_REVOCATION_MECHANISM = 1 << 4, | 19 CERT_STATUS_NO_REVOCATION_MECHANISM = 1 << 4, |
20 CERT_STATUS_UNABLE_TO_CHECK_REVOCATION = 1 << 5, | 20 CERT_STATUS_UNABLE_TO_CHECK_REVOCATION = 1 << 5, |
21 CERT_STATUS_REVOKED = 1 << 6, | 21 CERT_STATUS_REVOKED = 1 << 6, |
22 CERT_STATUS_INVALID = 1 << 7, | 22 CERT_STATUS_INVALID = 1 << 7, |
(...skipping 19 matching lines...) Expand all Loading... |
42 // the error code is not a certificate error, it is mapped to 0. | 42 // the error code is not a certificate error, it is mapped to 0. |
43 int MapNetErrorToCertStatus(int error); | 43 int MapNetErrorToCertStatus(int error); |
44 | 44 |
45 // Maps the most serious certificate error in the certificate status flags | 45 // Maps the most serious certificate error in the certificate status flags |
46 // to the equivalent network error code. | 46 // to the equivalent network error code. |
47 int MapCertStatusToNetError(int cert_status); | 47 int MapCertStatusToNetError(int cert_status); |
48 | 48 |
49 } // namespace net | 49 } // namespace net |
50 | 50 |
51 #endif // NET_BASE_CERT_STATUS_FLAGS_H_ | 51 #endif // NET_BASE_CERT_STATUS_FLAGS_H_ |
OLD | NEW |