Lines Matching refs:gen

68 static int do_othername(GENERAL_NAME *gen, char *value, X509V3_CTX *ctx);
69 static int do_dirname(GENERAL_NAME *gen, char *value, X509V3_CTX *ctx);
97 GENERAL_NAME *gen;
99 gen = sk_GENERAL_NAME_value(gens, i);
100 ret = i2v_GENERAL_NAME(method, gen, ret);
107 GENERAL_NAME *gen, STACK_OF(CONF_VALUE) *ret)
112 switch (gen->type)
127 X509V3_add_value_uchar("email",gen->d.ia5->data, &ret);
131 X509V3_add_value_uchar("DNS",gen->d.ia5->data, &ret);
135 X509V3_add_value_uchar("URI",gen->d.ia5->data, &ret);
139 X509_NAME_oneline(gen->d.dirn, oline, 256);
144 p = gen->d.ip->data;
145 if(gen->d.ip->length == 4)
148 else if(gen->d.ip->length == 16)
170 i2t_ASN1_OBJECT(oline, 256, gen->d.rid);
177 int GENERAL_NAME_print(BIO *out, GENERAL_NAME *gen)
181 switch (gen->type)
197 BIO_printf(out, "email:%s",gen->d.ia5->data);
201 BIO_printf(out, "DNS:%s",gen->d.ia5->data);
205 BIO_printf(out, "URI:%s",gen->d.ia5->data);
210 X509_NAME_print_ex(out, gen->d.dirn, 0, XN_FLAG_ONELINE);
214 p = gen->d.ip->data;
215 if(gen->d.ip->length == 4)
218 else if(gen->d.ip->length == 16)
237 i2a_ASN1_OBJECT(out, gen->d.rid);
259 GENERAL_NAME *gen;
260 if(!(gen = v2i_GENERAL_NAME(method, ctx, cnf)))
262 sk_GENERAL_NAME_push(gens, gen);
276 GENERAL_NAME *gen;
293 gen = sk_GENERAL_NAME_value(ialt, i);
294 if(!sk_GENERAL_NAME_push(gens, gen)) {
327 GENERAL_NAME *gen;
328 if(!(gen = v2i_GENERAL_NAME(method, ctx, cnf)))
330 sk_GENERAL_NAME_push(gens, gen);
348 GENERAL_NAME *gen = NULL;
372 if(!email || !(gen = GENERAL_NAME_new())) {
376 gen->d.ia5 = email;
378 gen->type = GEN_EMAIL;
379 if(!sk_GENERAL_NAME_push(gens, gen)) {
383 gen = NULL;
390 GENERAL_NAME_free(gen);
399 GENERAL_NAME *gen;
409 if(!(gen = v2i_GENERAL_NAME(method, ctx, cnf))) goto err;
410 sk_GENERAL_NAME_push(gens, gen);
429 GENERAL_NAME *gen = NULL;
438 gen = out;
441 gen = GENERAL_NAME_new();
442 if(gen == NULL)
466 gen->d.rid = obj;
472 gen->d.ip = a2i_IPADDRESS_NC(value);
474 gen->d.ip = a2i_IPADDRESS(value);
475 if(gen->d.ip == NULL)
484 if (!do_dirname(gen, value, ctx))
492 if (!do_othername(gen, value, ctx))
505 if(!(gen->d.ia5 = M_ASN1_IA5STRING_new()) ||
506 !ASN1_STRING_set(gen->d.ia5, (unsigned char*)value,
514 gen->type = gen_type;
516 return gen;
520 GENERAL_NAME_free(gen);
566 static int do_othername(GENERAL_NAME *gen, char *value, X509V3_CTX *ctx)
572 if (!(gen->d.otherName = OTHERNAME_new()))
577 ASN1_TYPE_free(gen->d.otherName->value);
578 if (!(gen->d.otherName->value = ASN1_generate_v3(p + 1, ctx)))
584 gen->d.otherName->type_id = OBJ_txt2obj(objtmp, 0);
586 if (!gen->d.otherName->type_id)
591 static int do_dirname(GENERAL_NAME *gen, char *value, X509V3_CTX *ctx)
610 gen->d.dirn = nm;