diff options
author | tb <> | 2023-04-21 06:11:56 +0000 |
---|---|---|
committer | tb <> | 2023-04-21 06:11:56 +0000 |
commit | 35d651b970e9882e23ef31f89b2b50a4535956b3 (patch) | |
tree | dd453e919491a22cb8988e2c5a8ed5db28eaa684 | |
parent | af98f5cdbc5f574e1562f0b8b599d38cbeb1f6ac (diff) | |
download | openbsd-35d651b970e9882e23ef31f89b2b50a4535956b3.tar.gz openbsd-35d651b970e9882e23ef31f89b2b50a4535956b3.tar.bz2 openbsd-35d651b970e9882e23ef31f89b2b50a4535956b3.zip |
Move the CRL reason method into x509_bitst.c
The CRL extension handler is completely misplaced in x509_enum.c.
Move it to x509_bitst.c until we find a better home for it. This
way it is next to the other two extension methods that have the
extra usr_data contortion.
-rw-r--r-- | src/lib/libcrypto/x509/x509_bitst.c | 33 | ||||
-rw-r--r-- | src/lib/libcrypto/x509/x509_enum.c | 33 |
2 files changed, 33 insertions, 33 deletions
diff --git a/src/lib/libcrypto/x509/x509_bitst.c b/src/lib/libcrypto/x509/x509_bitst.c index cacbe8efe7..97c630d8b7 100644 --- a/src/lib/libcrypto/x509/x509_bitst.c +++ b/src/lib/libcrypto/x509/x509_bitst.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: x509_bitst.c,v 1.3 2023/02/16 08:38:17 tb Exp $ */ | 1 | /* $OpenBSD: x509_bitst.c,v 1.4 2023/04/21 06:11:56 tb Exp $ */ |
2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | 2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL |
3 | * project 1999. | 3 | * project 1999. |
4 | */ | 4 | */ |
@@ -88,6 +88,20 @@ static BIT_STRING_BITNAME key_usage_type_table[] = { | |||
88 | {-1, NULL, NULL} | 88 | {-1, NULL, NULL} |
89 | }; | 89 | }; |
90 | 90 | ||
91 | static BIT_STRING_BITNAME crl_reasons[] = { | ||
92 | {CRL_REASON_UNSPECIFIED, "Unspecified", "unspecified"}, | ||
93 | {CRL_REASON_KEY_COMPROMISE, "Key Compromise", "keyCompromise"}, | ||
94 | {CRL_REASON_CA_COMPROMISE, "CA Compromise", "CACompromise"}, | ||
95 | {CRL_REASON_AFFILIATION_CHANGED, "Affiliation Changed", "affiliationChanged"}, | ||
96 | {CRL_REASON_SUPERSEDED, "Superseded", "superseded"}, | ||
97 | {CRL_REASON_CESSATION_OF_OPERATION, "Cessation Of Operation", "cessationOfOperation"}, | ||
98 | {CRL_REASON_CERTIFICATE_HOLD, "Certificate Hold", "certificateHold"}, | ||
99 | {CRL_REASON_REMOVE_FROM_CRL, "Remove From CRL", "removeFromCRL"}, | ||
100 | {CRL_REASON_PRIVILEGE_WITHDRAWN, "Privilege Withdrawn", "privilegeWithdrawn"}, | ||
101 | {CRL_REASON_AA_COMPROMISE, "AA Compromise", "AACompromise"}, | ||
102 | {-1, NULL, NULL} | ||
103 | }; | ||
104 | |||
91 | const X509V3_EXT_METHOD v3_nscert = { | 105 | const X509V3_EXT_METHOD v3_nscert = { |
92 | .ext_nid = NID_netscape_cert_type, | 106 | .ext_nid = NID_netscape_cert_type, |
93 | .ext_flags = 0, | 107 | .ext_flags = 0, |
@@ -122,6 +136,23 @@ const X509V3_EXT_METHOD v3_key_usage = { | |||
122 | .usr_data = key_usage_type_table, | 136 | .usr_data = key_usage_type_table, |
123 | }; | 137 | }; |
124 | 138 | ||
139 | const X509V3_EXT_METHOD v3_crl_reason = { | ||
140 | .ext_nid = NID_crl_reason, | ||
141 | .ext_flags = 0, | ||
142 | .it = &ASN1_ENUMERATED_it, | ||
143 | .ext_new = NULL, | ||
144 | .ext_free = NULL, | ||
145 | .d2i = NULL, | ||
146 | .i2d = NULL, | ||
147 | .i2s = (X509V3_EXT_I2S)i2s_ASN1_ENUMERATED_TABLE, | ||
148 | .s2i = NULL, | ||
149 | .i2v = NULL, | ||
150 | .v2i = NULL, | ||
151 | .i2r = NULL, | ||
152 | .r2i = NULL, | ||
153 | .usr_data = crl_reasons, | ||
154 | }; | ||
155 | |||
125 | STACK_OF(CONF_VALUE) * | 156 | STACK_OF(CONF_VALUE) * |
126 | i2v_ASN1_BIT_STRING(X509V3_EXT_METHOD *method, ASN1_BIT_STRING *bits, | 157 | i2v_ASN1_BIT_STRING(X509V3_EXT_METHOD *method, ASN1_BIT_STRING *bits, |
127 | STACK_OF(CONF_VALUE) *ret) | 158 | STACK_OF(CONF_VALUE) *ret) |
diff --git a/src/lib/libcrypto/x509/x509_enum.c b/src/lib/libcrypto/x509/x509_enum.c index 0f3bfea4c7..9e8a29155a 100644 --- a/src/lib/libcrypto/x509/x509_enum.c +++ b/src/lib/libcrypto/x509/x509_enum.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: x509_enum.c,v 1.6 2023/04/21 06:07:10 tb Exp $ */ | 1 | /* $OpenBSD: x509_enum.c,v 1.7 2023/04/21 06:11:56 tb Exp $ */ |
2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | 2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL |
3 | * project 1999. | 3 | * project 1999. |
4 | */ | 4 | */ |
@@ -61,34 +61,3 @@ | |||
61 | 61 | ||
62 | #include <openssl/asn1.h> | 62 | #include <openssl/asn1.h> |
63 | #include <openssl/x509v3.h> | 63 | #include <openssl/x509v3.h> |
64 | |||
65 | static BIT_STRING_BITNAME crl_reasons[] = { | ||
66 | {CRL_REASON_UNSPECIFIED, "Unspecified", "unspecified"}, | ||
67 | {CRL_REASON_KEY_COMPROMISE, "Key Compromise", "keyCompromise"}, | ||
68 | {CRL_REASON_CA_COMPROMISE, "CA Compromise", "CACompromise"}, | ||
69 | {CRL_REASON_AFFILIATION_CHANGED, "Affiliation Changed", "affiliationChanged"}, | ||
70 | {CRL_REASON_SUPERSEDED, "Superseded", "superseded"}, | ||
71 | {CRL_REASON_CESSATION_OF_OPERATION, "Cessation Of Operation", "cessationOfOperation"}, | ||
72 | {CRL_REASON_CERTIFICATE_HOLD, "Certificate Hold", "certificateHold"}, | ||
73 | {CRL_REASON_REMOVE_FROM_CRL, "Remove From CRL", "removeFromCRL"}, | ||
74 | {CRL_REASON_PRIVILEGE_WITHDRAWN, "Privilege Withdrawn", "privilegeWithdrawn"}, | ||
75 | {CRL_REASON_AA_COMPROMISE, "AA Compromise", "AACompromise"}, | ||
76 | {-1, NULL, NULL} | ||
77 | }; | ||
78 | |||
79 | const X509V3_EXT_METHOD v3_crl_reason = { | ||
80 | .ext_nid = NID_crl_reason, | ||
81 | .ext_flags = 0, | ||
82 | .it = &ASN1_ENUMERATED_it, | ||
83 | .ext_new = NULL, | ||
84 | .ext_free = NULL, | ||
85 | .d2i = NULL, | ||
86 | .i2d = NULL, | ||
87 | .i2s = (X509V3_EXT_I2S)i2s_ASN1_ENUMERATED_TABLE, | ||
88 | .s2i = NULL, | ||
89 | .i2v = NULL, | ||
90 | .v2i = NULL, | ||
91 | .i2r = NULL, | ||
92 | .r2i = NULL, | ||
93 | .usr_data = crl_reasons, | ||
94 | }; | ||