2015-01-22 03:40:55 +00:00
|
|
|
/*
|
2016-05-17 18:51:26 +00:00
|
|
|
* Copyright 1999-2016 The OpenSSL Project Authors. All Rights Reserved.
|
1999-02-20 01:15:41 +00:00
|
|
|
*
|
2016-05-17 18:51:26 +00:00
|
|
|
* Licensed under the OpenSSL license (the "License"). You may not use
|
|
|
|
* 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 01:15:41 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdio.h>
|
2015-05-14 14:56:48 +00:00
|
|
|
#include "internal/cryptlib.h"
|
1999-04-23 22:13:45 +00:00
|
|
|
#include <openssl/x509v3.h>
|
2015-09-05 12:32:58 +00:00
|
|
|
#include "ext_dat.h"
|
1999-02-20 01:15:41 +00:00
|
|
|
|
|
|
|
static ENUMERATED_NAMES crl_reasons[] = {
|
2015-01-22 03:40:55 +00: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"},
|
|
|
|
{-1, NULL, NULL}
|
1999-02-20 01:15:41 +00:00
|
|
|
};
|
|
|
|
|
2015-01-22 03:40:55 +00:00
|
|
|
const X509V3_EXT_METHOD v3_crl_reason = {
|
|
|
|
NID_crl_reason, 0, ASN1_ITEM_ref(ASN1_ENUMERATED),
|
|
|
|
0, 0, 0, 0,
|
|
|
|
(X509V3_EXT_I2S)i2s_ASN1_ENUMERATED_TABLE,
|
|
|
|
0,
|
|
|
|
0, 0, 0, 0,
|
|
|
|
crl_reasons
|
|
|
|
};
|
1999-02-20 01:15:41 +00:00
|
|
|
|
2016-10-10 16:01:24 +00:00
|
|
|
char *i2s_ASN1_ENUMERATED_TABLE(X509V3_EXT_METHOD *method,
|
2016-08-11 22:40:49 +00:00
|
|
|
const ASN1_ENUMERATED *e)
|
1999-02-20 01:15:41 +00:00
|
|
|
{
|
2015-01-22 03:40:55 +00:00
|
|
|
ENUMERATED_NAMES *enam;
|
|
|
|
long strval;
|
2016-08-11 22:40:49 +00:00
|
|
|
|
2015-01-22 03:40:55 +00:00
|
|
|
strval = ASN1_ENUMERATED_get(e);
|
|
|
|
for (enam = method->usr_data; enam->lname; enam++) {
|
|
|
|
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-16 21:12:24 +00:00
|
|
|
return OPENSSL_strdup(enam->lname);
|
2015-01-22 03:40:55 +00:00
|
|
|
}
|
|
|
|
return i2s_ASN1_ENUMERATED(method, e);
|
1999-02-20 01:15:41 +00:00
|
|
|
}
|