Lines Matching refs:ctx
22 static X509_EXTENSION *do_ext_nconf(CONF *conf, X509V3_CTX *ctx, int ext_nid,
26 X509V3_CTX *ctx);
31 static unsigned char *generic_asn1(const char *value, X509V3_CTX *ctx,
34 static X509_EXTENSION *X509V3_EXT_nconf_int(CONF *conf, X509V3_CTX *ctx,
44 return v3_generic_extension(name, value, crit, ext_type, ctx);
45 ret = do_ext_nconf(conf, ctx, OBJ_sn2nid(name), crit, value);
58 X509_EXTENSION *X509V3_EXT_nconf(CONF *conf, X509V3_CTX *ctx, const char *name,
61 return X509V3_EXT_nconf_int(conf, ctx, NULL, name, value);
64 X509_EXTENSION *X509V3_EXT_nconf_nid(CONF *conf, X509V3_CTX *ctx, int ext_nid,
73 value, crit, ext_type, ctx);
74 return do_ext_nconf(conf, ctx, ext_nid, crit, value);
79 static X509_EXTENSION *do_ext_nconf(CONF *conf, X509V3_CTX *ctx, int ext_nid,
108 ext_struc = method->v2i(method, ctx, nval);
114 if ((ext_struc = method->s2i(method, ctx, value)) == NULL)
117 if (!ctx->db || !ctx->db_meth) {
121 if ((ext_struc = method->r2i(method, ctx, value)) == NULL)
236 X509V3_CTX *ctx)
253 ext_der = generic_asn1(value, ctx, &ext_len);
280 static unsigned char *generic_asn1(const char *value, X509V3_CTX *ctx,
286 typ = ASN1_generate_v3(value, ctx);
309 int X509V3_EXT_add_nconf_sk(CONF *conf, X509V3_CTX *ctx, const char *section,
321 if ((ext = X509V3_EXT_nconf_int(conf, ctx, val->section,
325 if (ctx->flags == X509V3_CTX_REPLACE)
341 int X509V3_EXT_add_nconf(CONF *conf, X509V3_CTX *ctx, const char *section,
347 return X509V3_EXT_add_nconf_sk(conf, ctx, section, sk);
354 int X509V3_EXT_CRL_add_nconf(CONF *conf, X509V3_CTX *ctx, const char *section,
360 return X509V3_EXT_add_nconf_sk(conf, ctx, section, sk);
367 int X509V3_EXT_REQ_add_nconf(CONF *conf, X509V3_CTX *ctx, const char *section,
371 int ret = X509V3_EXT_add_nconf_sk(conf, ctx, section, &exts);
381 char *X509V3_get_string(X509V3_CTX *ctx, const char *name, const char *section)
383 if (!ctx->db || !ctx->db_meth || !ctx->db_meth->get_string) {
387 if (ctx->db_meth->get_string)
388 return ctx->db_meth->get_string(ctx->db, name, section);
392 STACK_OF(CONF_VALUE) *X509V3_get_section(X509V3_CTX *ctx, const char *section)
394 if (!ctx->db || !ctx->db_meth || !ctx->db_meth->get_section) {
398 if (ctx->db_meth->get_section)
399 return ctx->db_meth->get_section(ctx->db, section);
403 void X509V3_string_free(X509V3_CTX *ctx, char *str)
407 if (ctx->db_meth->free_string)
408 ctx->db_meth->free_string(ctx->db, str);
411 void X509V3_section_free(X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *section)
415 if (ctx->db_meth->free_section)
416 ctx->db_meth->free_section(ctx->db, section);
436 void X509V3_set_nconf(X509V3_CTX *ctx, CONF *conf)
438 if (ctx == NULL) {
442 ctx->db_meth = &nconf_method;
443 ctx->db = conf;
446 void X509V3_set_ctx(X509V3_CTX *ctx, X509 *issuer, X509 *subj, X509_REQ *req,
449 if (ctx == NULL) {
453 ctx->flags = flags;
454 ctx->issuer_cert = issuer;
455 ctx->subject_cert = subj;
456 ctx->subject_req = req;
457 ctx->crl = crl;
458 ctx->db_meth = NULL;
459 ctx->db = NULL;
460 ctx->issuer_pkey = NULL;
464 int X509V3_set_issuer_pkey(X509V3_CTX *ctx, EVP_PKEY *pkey)
466 if (ctx == NULL) {
470 if (ctx->subject_cert == NULL && pkey != NULL) {
474 ctx->issuer_pkey = pkey;
480 X509_EXTENSION *X509V3_EXT_conf(LHASH_OF(CONF_VALUE) *conf, X509V3_CTX *ctx,
489 ret = X509V3_EXT_nconf(ctmp, ctx, name, value);
496 X509V3_CTX *ctx, int ext_nid, const char *value)
504 ret = X509V3_EXT_nconf_nid(ctmp, ctx, ext_nid, value);
527 void X509V3_set_conf_lhash(X509V3_CTX *ctx, LHASH_OF(CONF_VALUE) *lhash)
529 if (ctx == NULL) {
533 ctx->db_meth = &conf_lhash_method;
534 ctx->db = lhash;
537 int X509V3_EXT_add_conf(LHASH_OF(CONF_VALUE) *conf, X509V3_CTX *ctx,
546 ret = X509V3_EXT_add_nconf(ctmp, ctx, section, cert);
554 int X509V3_EXT_CRL_add_conf(LHASH_OF(CONF_VALUE) *conf, X509V3_CTX *ctx,
563 ret = X509V3_EXT_CRL_add_nconf(ctmp, ctx, section, crl);
571 int X509V3_EXT_REQ_add_conf(LHASH_OF(CONF_VALUE) *conf, X509V3_CTX *ctx,
580 ret = X509V3_EXT_REQ_add_nconf(ctmp, ctx, section, req);