Lines Matching refs:ctx

71 static X509_EXTENSION *do_ext_nconf(CONF *conf, X509V3_CTX *ctx, int ext_nid, int crit, char *value);
72 static X509_EXTENSION *v3_generic_extension(const char *ext, char *value, int crit, int type, X509V3_CTX *ctx);
77 static unsigned char *generic_asn1(char *value, X509V3_CTX *ctx, long *ext_len);
81 X509_EXTENSION *X509V3_EXT_nconf(CONF *conf, X509V3_CTX *ctx, char *name,
89 return v3_generic_extension(name, value, crit, ext_type, ctx);
90 ret = do_ext_nconf(conf, ctx, OBJ_sn2nid(name), crit, value);
101 X509_EXTENSION *X509V3_EXT_nconf_nid(CONF *conf, X509V3_CTX *ctx, int ext_nid,
109 value, crit, ext_type, ctx);
110 return do_ext_nconf(conf, ctx, ext_nid, crit, value);
115 static X509_EXTENSION *do_ext_nconf(CONF *conf, X509V3_CTX *ctx, int ext_nid,
143 ext_struc = method->v2i(method, ctx, nval);
150 if(!(ext_struc = method->s2i(method, ctx, value))) return NULL;
154 if(!ctx->db || !ctx->db_meth)
159 if(!(ext_struc = method->r2i(method, ctx, value))) return NULL;
262 X509V3_CTX *ctx)
279 ext_der = generic_asn1(value, ctx, &ext_len);
308 static unsigned char *generic_asn1(char *value, X509V3_CTX *ctx, long *ext_len)
312 typ = ASN1_generate_v3(value, ctx);
325 int X509V3_EXT_add_nconf_sk(CONF *conf, X509V3_CTX *ctx, char *section,
336 if (!(ext = X509V3_EXT_nconf(conf, ctx, val->name, val->value)))
346 int X509V3_EXT_add_nconf(CONF *conf, X509V3_CTX *ctx, char *section,
352 return X509V3_EXT_add_nconf_sk(conf, ctx, section, sk);
357 int X509V3_EXT_CRL_add_nconf(CONF *conf, X509V3_CTX *ctx, char *section,
363 return X509V3_EXT_add_nconf_sk(conf, ctx, section, sk);
368 int X509V3_EXT_REQ_add_nconf(CONF *conf, X509V3_CTX *ctx, char *section,
375 i = X509V3_EXT_add_nconf_sk(conf, ctx, section, sk);
385 char * X509V3_get_string(X509V3_CTX *ctx, char *name, char *section)
387 if(!ctx->db || !ctx->db_meth || !ctx->db_meth->get_string)
392 if (ctx->db_meth->get_string)
393 return ctx->db_meth->get_string(ctx->db, name, section);
397 STACK_OF(CONF_VALUE) * X509V3_get_section(X509V3_CTX *ctx, char *section)
399 if(!ctx->db || !ctx->db_meth || !ctx->db_meth->get_section)
404 if (ctx->db_meth->get_section)
405 return ctx->db_meth->get_section(ctx->db, section);
409 void X509V3_string_free(X509V3_CTX *ctx, char *str)
412 if (ctx->db_meth->free_string)
413 ctx->db_meth->free_string(ctx->db, str);
416 void X509V3_section_free(X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *section)
419 if (ctx->db_meth->free_section)
420 ctx->db_meth->free_section(ctx->db, section);
440 void X509V3_set_nconf(X509V3_CTX *ctx, CONF *conf)
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 ctx->issuer_cert = issuer;
450 ctx->subject_cert = subj;
451 ctx->crl = crl;
452 ctx->subject_req = req;
453 ctx->flags = flags;
458 X509_EXTENSION *X509V3_EXT_conf(LHASH_OF(CONF_VALUE) *conf, X509V3_CTX *ctx,
463 return X509V3_EXT_nconf(&ctmp, ctx, name, value);
468 X509_EXTENSION *X509V3_EXT_conf_nid(LHASH_OF(CONF_VALUE) *conf, X509V3_CTX *ctx,
473 return X509V3_EXT_nconf_nid(&ctmp, ctx, ext_nid, value);
493 void X509V3_set_conf_lhash(X509V3_CTX *ctx, LHASH_OF(CONF_VALUE) *lhash)
495 ctx->db_meth = &conf_lhash_method;
496 ctx->db = lhash;
499 int X509V3_EXT_add_conf(LHASH_OF(CONF_VALUE) *conf, X509V3_CTX *ctx,
504 return X509V3_EXT_add_nconf(&ctmp, ctx, section, cert);
509 int X509V3_EXT_CRL_add_conf(LHASH_OF(CONF_VALUE) *conf, X509V3_CTX *ctx,
514 return X509V3_EXT_CRL_add_nconf(&ctmp, ctx, section, crl);
519 int X509V3_EXT_REQ_add_conf(LHASH_OF(CONF_VALUE) *conf, X509V3_CTX *ctx,
524 return X509V3_EXT_REQ_add_nconf(&ctmp, ctx, section, req);