Skip to content

Commit 7fb4bd7

Browse files
davidbennebeid
authored andcommitted
Move CRL_REASON_* back to x509v3.h
strongswan defines conflicting symbols and has been relying on them only being defined in <openssl/x509v3.h>. Defining the constants in <openssl/x509.h> would break strongswan, so move them back for now. Long term, we would like for new code to only need <openssl/x509.h>, so I've left a TODO to introduce properly namespaced versions of these constants and, separately, see if we can fix strongswan to similarly avoid the conflict. Between OpenSSL, strongswan, and wincrypt.h all defining these constants, it seems best for everyone to just avoid them going forward. Change-Id: I23ce4c5013a80a831e0dc74fda8623027017190c Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/65387 Commit-Queue: Bob Beck <[email protected]> Auto-Submit: David Benjamin <[email protected]> Reviewed-by: Bob Beck <[email protected]> Commit-Queue: David Benjamin <[email protected]> (cherry picked from commit 45f5e5da1235b13220599fa04b7a648f29db80c3)
1 parent 4ac1742 commit 7fb4bd7

File tree

4 files changed

+26
-12
lines changed

4 files changed

+26
-12
lines changed

crypto/x509/v3_enum.c

+1
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
#include <openssl/mem.h>
6060
#include <openssl/obj.h>
6161
#include <openssl/x509.h>
62+
#include <openssl/x509v3.h>
6263

6364
#include "internal.h"
6465

crypto/x509/x_crl.c

+1
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
#include <openssl/stack.h>
6464
#include <openssl/thread.h>
6565
#include <openssl/x509.h>
66+
#include <openssl/x509v3.h>
6667

6768
#include <assert.h>
6869

include/openssl/x509.h

-12
Original file line numberDiff line numberDiff line change
@@ -4411,18 +4411,6 @@ typedef struct DIST_POINT_NAME_st {
44114411
// CRLDP_ALL_REASONS is an alias for all existing reasons
44124412
#define CRLDP_ALL_REASONS 0x807f
44134413

4414-
#define CRL_REASON_NONE (-1)
4415-
#define CRL_REASON_UNSPECIFIED 0
4416-
#define CRL_REASON_KEY_COMPROMISE 1
4417-
#define CRL_REASON_CA_COMPROMISE 2
4418-
#define CRL_REASON_AFFILIATION_CHANGED 3
4419-
#define CRL_REASON_SUPERSEDED 4
4420-
#define CRL_REASON_CESSATION_OF_OPERATION 5
4421-
#define CRL_REASON_CERTIFICATE_HOLD 6
4422-
#define CRL_REASON_REMOVE_FROM_CRL 8
4423-
#define CRL_REASON_PRIVILEGE_WITHDRAWN 9
4424-
#define CRL_REASON_AA_COMPROMISE 10
4425-
44264414
struct DIST_POINT_st {
44274415
DIST_POINT_NAME *distpoint;
44284416
ASN1_BIT_STRING *reasons;

include/openssl/x509v3.h

+24
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,30 @@
2020
// However, due to conflicts, some deprecated symbols are defined here.
2121
#include <openssl/x509.h>
2222

23+
24+
// CRL reason constants.
25+
26+
// TODO(davidben): These constants live here because strongswan defines
27+
// conflicting symbols and has been relying on them only being defined in
28+
// <openssl/x509v3.h>. Defining the constants in <openssl/x509.h> would break
29+
// strongswan, but we would also like for new code to only need
30+
// <openssl/x509.h>. Introduce properly namespaced versions of these constants
31+
// and, separately, see if we can fix strongswan to similarly avoid the
32+
// conflict. Between OpenSSL, strongswan, and wincrypt.h all defining these
33+
// constants, it seems best for everyone to just avoid them going forward.
34+
#define CRL_REASON_NONE (-1)
35+
#define CRL_REASON_UNSPECIFIED 0
36+
#define CRL_REASON_KEY_COMPROMISE 1
37+
#define CRL_REASON_CA_COMPROMISE 2
38+
#define CRL_REASON_AFFILIATION_CHANGED 3
39+
#define CRL_REASON_SUPERSEDED 4
40+
#define CRL_REASON_CESSATION_OF_OPERATION 5
41+
#define CRL_REASON_CERTIFICATE_HOLD 6
42+
#define CRL_REASON_REMOVE_FROM_CRL 8
43+
#define CRL_REASON_PRIVILEGE_WITHDRAWN 9
44+
#define CRL_REASON_AA_COMPROMISE 10
45+
46+
2347
// Deprecated constants.
2448

2549
// The following constants are legacy aliases for |X509v3_KU_*|. They are

0 commit comments

Comments
 (0)