2008-11-06 02:39:08 +08:00
|
|
|
/*
|
2021-04-08 20:04:41 +08:00
|
|
|
* Copyright 1999-2021 The OpenSSL Project Authors. All Rights Reserved.
|
1999-02-20 09:15:41 +08:00
|
|
|
*
|
2018-12-06 21:00:54 +08:00
|
|
|
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
2016-05-18 02:51:26 +08:00
|
|
|
* this file except in compliance with the License. You can obtain a copy
|
|
|
|
* in the file LICENSE in the source distribution or at
|
|
|
|
* https://www.openssl.org/source/license.html
|
1999-02-20 09:15:41 +08:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdio.h>
|
2015-05-14 22:56:48 +08:00
|
|
|
#include "internal/cryptlib.h"
|
1999-04-24 06:13:45 +08:00
|
|
|
#include <openssl/x509v3.h>
|
2015-09-05 20:32:58 +08:00
|
|
|
#include "ext_dat.h"
|
1999-02-20 09:15:41 +08:00
|
|
|
|
|
|
|
static ENUMERATED_NAMES crl_reasons[] = {
|
2008-09-01 23:15:16 +08:00
|
|
|
{CRL_REASON_UNSPECIFIED, "Unspecified", "unspecified"},
|
|
|
|
{CRL_REASON_KEY_COMPROMISE, "Key Compromise", "keyCompromise"},
|
|
|
|
{CRL_REASON_CA_COMPROMISE, "CA Compromise", "CACompromise"},
|
|
|
|
{CRL_REASON_AFFILIATION_CHANGED, "Affiliation Changed",
|
|
|
|
"affiliationChanged"},
|
|
|
|
{CRL_REASON_SUPERSEDED, "Superseded", "superseded"},
|
|
|
|
{CRL_REASON_CESSATION_OF_OPERATION,
|
|
|
|
"Cessation Of Operation", "cessationOfOperation"},
|
|
|
|
{CRL_REASON_CERTIFICATE_HOLD, "Certificate Hold", "certificateHold"},
|
|
|
|
{CRL_REASON_REMOVE_FROM_CRL, "Remove From CRL", "removeFromCRL"},
|
|
|
|
{CRL_REASON_PRIVILEGE_WITHDRAWN, "Privilege Withdrawn",
|
|
|
|
"privilegeWithdrawn"},
|
|
|
|
{CRL_REASON_AA_COMPROMISE, "AA Compromise", "AACompromise"},
|
1999-02-20 09:15:41 +08:00
|
|
|
{-1, NULL, NULL}
|
|
|
|
};
|
|
|
|
|
2021-03-09 08:52:15 +08:00
|
|
|
const X509V3_EXT_METHOD ossl_v3_crl_reason = {
|
2001-02-23 11:16:09 +08:00
|
|
|
NID_crl_reason, 0, ASN1_ITEM_ref(ASN1_ENUMERATED),
|
2000-12-13 21:47:33 +08:00
|
|
|
0, 0, 0, 0,
|
1999-02-20 09:15:41 +08:00
|
|
|
(X509V3_EXT_I2S)i2s_ASN1_ENUMERATED_TABLE,
|
2000-12-13 21:47:33 +08:00
|
|
|
0,
|
|
|
|
0, 0, 0, 0,
|
|
|
|
crl_reasons
|
|
|
|
};
|
1999-02-20 09:15:41 +08:00
|
|
|
|
2016-10-11 00:01:24 +08:00
|
|
|
char *i2s_ASN1_ENUMERATED_TABLE(X509V3_EXT_METHOD *method,
|
2016-08-12 06:40:49 +08:00
|
|
|
const ASN1_ENUMERATED *e)
|
1999-02-20 09:15:41 +08:00
|
|
|
{
|
|
|
|
ENUMERATED_NAMES *enam;
|
|
|
|
long strval;
|
2016-08-12 06:40:49 +08:00
|
|
|
|
1999-02-20 09:15:41 +08:00
|
|
|
strval = ASN1_ENUMERATED_get(e);
|
1999-05-10 00:39:11 +08:00
|
|
|
for (enam = method->usr_data; enam->lname; enam++) {
|
1999-03-05 07:29:51 +08:00
|
|
|
if (strval == enam->bitnum)
|
Rename some BUF_xxx to OPENSSL_xxx
Rename BUF_{strdup,strlcat,strlcpy,memdup,strndup,strnlen}
to OPENSSL_{strdup,strlcat,strlcpy,memdup,strndup,strnlen}
Add #define's for the old names.
Add CRYPTO_{memdup,strndup}, called by OPENSSL_{memdup,strndup} macros.
Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-12-17 05:12:24 +08:00
|
|
|
return OPENSSL_strdup(enam->lname);
|
1999-02-20 09:15:41 +08:00
|
|
|
}
|
|
|
|
return i2s_ASN1_ENUMERATED(method, e);
|
|
|
|
}
|