| 1 |
// Copyright (c) 2023, Google Inc. |
| 2 |
// SPDX-License-Identifier: ISC |
| 3 |
|
| 4 |
#ifndef OPENSSL_HEADER_X509V3_H |
| 5 |
#define OPENSSL_HEADER_X509V3_H |
| 6 |
|
| 7 |
// This header primarily exists in order to make compiling against code that |
| 8 |
// expects OpenSSL easier. We have merged this header into <openssl/x509.h>. |
| 9 |
// However, due to conflicts, some deprecated symbols are defined here. |
| 10 |
#include <openssl/x509.h> |
| 11 |
|
| 12 |
|
| 13 |
// CRL reason constants. |
| 14 |
|
| 15 |
// TODO(davidben): These constants live here because strongswan defines |
| 16 |
// conflicting symbols and has been relying on them only being defined in |
| 17 |
// <openssl/x509v3.h>. Defining the constants in <openssl/x509.h> would break |
| 18 |
// strongswan, but we would also like for new code to only need |
| 19 |
// <openssl/x509.h>. Introduce properly namespaced versions of these constants |
| 20 |
// and, separately, see if we can fix strongswan to similarly avoid the |
| 21 |
// conflict. Between OpenSSL, strongswan, and wincrypt.h all defining these |
| 22 |
// constants, it seems best for everyone to just avoid them going forward. |
| 23 |
#define CRL_REASON_NONE (-1) |
| 24 |
#define CRL_REASON_UNSPECIFIED 0 |
| 25 |
#define CRL_REASON_KEY_COMPROMISE 1 |
| 26 |
#define CRL_REASON_CA_COMPROMISE 2 |
| 27 |
#define CRL_REASON_AFFILIATION_CHANGED 3 |
| 28 |
#define CRL_REASON_SUPERSEDED 4 |
| 29 |
#define CRL_REASON_CESSATION_OF_OPERATION 5 |
| 30 |
#define CRL_REASON_CERTIFICATE_HOLD 6 |
| 31 |
#define CRL_REASON_REMOVE_FROM_CRL 8 |
| 32 |
#define CRL_REASON_PRIVILEGE_WITHDRAWN 9 |
| 33 |
#define CRL_REASON_AA_COMPROMISE 10 |
| 34 |
|
| 35 |
|
| 36 |
// Deprecated constants. |
| 37 |
|
| 38 |
// The following constants are legacy aliases for |X509v3_KU_*|. They are |
| 39 |
// defined here instead of in <openssl/x509.h> because NSS's public headers use |
| 40 |
// the same symbols. Some callers have inadvertently relied on the conflicts |
| 41 |
// only being defined in this header. |
| 42 |
#define KU_DIGITAL_SIGNATURE X509v3_KU_DIGITAL_SIGNATURE |
| 43 |
#define KU_NON_REPUDIATION X509v3_KU_NON_REPUDIATION |
| 44 |
#define KU_KEY_ENCIPHERMENT X509v3_KU_KEY_ENCIPHERMENT |
| 45 |
#define KU_DATA_ENCIPHERMENT X509v3_KU_DATA_ENCIPHERMENT |
| 46 |
#define KU_KEY_AGREEMENT X509v3_KU_KEY_AGREEMENT |
| 47 |
#define KU_KEY_CERT_SIGN X509v3_KU_KEY_CERT_SIGN |
| 48 |
#define KU_CRL_SIGN X509v3_KU_CRL_SIGN |
| 49 |
#define KU_ENCIPHER_ONLY X509v3_KU_ENCIPHER_ONLY |
| 50 |
#define KU_DECIPHER_ONLY X509v3_KU_DECIPHER_ONLY |
| 51 |
|
| 52 |
#endif // OPENSSL_HEADER_X509V3_H |