-/* $OpenBSD: x509_conf.c,v 1.13 2024/06/18 05:39:52 tb Exp $ */
+/* $OpenBSD: x509_conf.c,v 1.14 2024/06/18 05:56:37 tb Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project 1999.
*/
static STACK_OF(CONF_VALUE) *conf_lhash_get_section(void *db,
const char *section);
static X509_EXTENSION *do_ext_i2d(const X509V3_EXT_METHOD *method, int nid,
- int crit, void *ext_struc);
+ int crit, void *ext_struct);
static unsigned char *generic_asn1(const char *value, X509V3_CTX *ctx,
long *ext_len);
{
const X509V3_EXT_METHOD *method;
X509_EXTENSION *ext;
- void *ext_struc;
+ void *ext_struct;
if (nid == NID_undef) {
X509V3error(X509V3_R_UNKNOWN_EXTENSION_NAME);
sk_CONF_VALUE_pop_free(nval, X509V3_conf_free);
return NULL;
}
- ext_struc = method->v2i(method, ctx, nval);
+ ext_struct = method->v2i(method, ctx, nval);
if (*value != '@')
sk_CONF_VALUE_pop_free(nval, X509V3_conf_free);
} else if (method->s2i) {
- ext_struc = method->s2i(method, ctx, value);
+ ext_struct = method->s2i(method, ctx, value);
} else if (method->r2i) {
if (!ctx->db || !ctx->db_meth) {
X509V3error(X509V3_R_NO_CONFIG_DATABASE);
return NULL;
}
- ext_struc = method->r2i(method, ctx, value);
+ ext_struct = method->r2i(method, ctx, value);
} else {
X509V3error(X509V3_R_EXTENSION_SETTING_NOT_SUPPORTED);
ERR_asprintf_error_data("name=%s", OBJ_nid2sn(nid));
return NULL;
}
- if (ext_struc == NULL)
+ if (ext_struct == NULL)
return NULL;
- ext = do_ext_i2d(method, nid, crit, ext_struc);
+ ext = do_ext_i2d(method, nid, crit, ext_struct);
if (method->it)
- ASN1_item_free(ext_struc, method->it);
+ ASN1_item_free(ext_struct, method->it);
else
- method->ext_free(ext_struc);
+ method->ext_free(ext_struct);
return ext;
}
static X509_EXTENSION *
do_ext_i2d(const X509V3_EXT_METHOD *method, int nid, int crit,
- void *ext_struc)
+ void *ext_struct)
{
unsigned char *ext_der = NULL;
int ext_len;
/* Convert internal representation to DER */
if (method->it != NULL) {
ext_der = NULL;
- ext_len = ASN1_item_i2d(ext_struc, &ext_der, method->it);
+ ext_len = ASN1_item_i2d(ext_struct, &ext_der, method->it);
if (ext_len < 0)
goto merr;
} else {
unsigned char *p;
- if ((ext_len = method->i2d(ext_struc, NULL)) <= 0)
+ if ((ext_len = method->i2d(ext_struct, NULL)) <= 0)
goto merr;
if ((ext_der = calloc(1, ext_len)) == NULL)
goto merr;
p = ext_der;
- if (method->i2d(ext_struc, &p) != ext_len)
+ if (method->i2d(ext_struct, &p) != ext_len)
goto merr;
}
if ((ext_oct = ASN1_OCTET_STRING_new()) == NULL)
/* Given an internal structure, nid and critical flag create an extension */
X509_EXTENSION *
-X509V3_EXT_i2d(int nid, int crit, void *ext_struc)
+X509V3_EXT_i2d(int nid, int crit, void *ext_struct)
{
const X509V3_EXT_METHOD *method;
X509V3error(X509V3_R_UNKNOWN_EXTENSION);
return NULL;
}
- return do_ext_i2d(method, nid, crit, ext_struc);
+ return do_ext_i2d(method, nid, crit, ext_struct);
}
LCRYPTO_ALIAS(X509V3_EXT_i2d);