diff options
Diffstat (limited to 'src/lib/libcrypto/x509/x509_bitst.c')
-rw-r--r-- | src/lib/libcrypto/x509/x509_bitst.c | 33 |
1 files changed, 32 insertions, 1 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) |