Lines Matching refs:gen
26 static int do_othername(GENERAL_NAME *gen, const char *value, X509V3_CTX *ctx);
27 static int do_dirname(GENERAL_NAME *gen, const char *value, X509V3_CTX *ctx);
56 GENERAL_NAME *gen; in STACK_OF() local
60 gen = sk_GENERAL_NAME_value(gens, i); in STACK_OF()
66 tmpret = i2v_GENERAL_NAME(method, gen, ret); in STACK_OF()
80 GENERAL_NAME *gen, in STACK_OF()
86 switch (gen->type) { in STACK_OF()
88 switch (OBJ_obj2nid(gen->d.otherName->type_id)) { in STACK_OF()
90 if (gen->d.otherName->value->type != V_ASN1_UTF8STRING in STACK_OF()
92 gen->d.otherName->value->value.utf8string->data, in STACK_OF()
93 gen->d.otherName->value->value.utf8string->length, in STACK_OF()
98 if (gen->d.otherName->value->type != V_ASN1_UTF8STRING in STACK_OF()
100 gen->d.otherName->value->value.utf8string->data, in STACK_OF()
101 gen->d.otherName->value->value.utf8string->length, in STACK_OF()
106 if (gen->d.otherName->value->type != V_ASN1_IA5STRING in STACK_OF()
108 gen->d.otherName->value->value.ia5string->data, in STACK_OF()
109 gen->d.otherName->value->value.ia5string->length, in STACK_OF()
114 if (gen->d.otherName->value->type != V_ASN1_UTF8STRING in STACK_OF()
116 gen->d.otherName->value->value.utf8string->data, in STACK_OF()
117 gen->d.otherName->value->value.utf8string->length, in STACK_OF()
122 if (gen->d.otherName->value->type != V_ASN1_UTF8STRING in STACK_OF()
124 gen->d.otherName->value->value.utf8string->data, in STACK_OF()
125 gen->d.otherName->value->value.utf8string->length, in STACK_OF()
130 if (OBJ_obj2txt(oline, sizeof(oline), gen->d.otherName->type_id, 0) > 0) in STACK_OF()
137 if (gen->d.otherName->value->type == V_ASN1_IA5STRING) { in STACK_OF()
139 gen->d.otherName->value->value.ia5string->data, in STACK_OF()
140 gen->d.otherName->value->value.ia5string->length, in STACK_OF()
144 if (gen->d.otherName->value->type == V_ASN1_UTF8STRING) { in STACK_OF()
146 gen->d.otherName->value->value.utf8string->data, in STACK_OF()
147 gen->d.otherName->value->value.utf8string->length, in STACK_OF()
168 if (!x509v3_add_len_value_uchar("email", gen->d.ia5->data, in STACK_OF()
169 gen->d.ia5->length, &ret)) in STACK_OF()
174 if (!x509v3_add_len_value_uchar("DNS", gen->d.ia5->data, in STACK_OF()
175 gen->d.ia5->length, &ret)) in STACK_OF()
180 if (!x509v3_add_len_value_uchar("URI", gen->d.ia5->data, in STACK_OF()
181 gen->d.ia5->length, &ret)) in STACK_OF()
186 if (X509_NAME_oneline(gen->d.dirn, oline, sizeof(oline)) == NULL in STACK_OF()
192 tmp = ossl_ipaddr_to_asc(gen->d.ip->data, gen->d.ip->length); in STACK_OF()
199 i2t_ASN1_OBJECT(oline, 256, gen->d.rid); in STACK_OF()
207 int GENERAL_NAME_print(BIO *out, GENERAL_NAME *gen) in GENERAL_NAME_print() argument
212 switch (gen->type) { in GENERAL_NAME_print()
214 nid = OBJ_obj2nid(gen->d.otherName->type_id); in GENERAL_NAME_print()
217 && gen->d.otherName->value->type != V_ASN1_IA5STRING) in GENERAL_NAME_print()
219 && gen->d.otherName->value->type != V_ASN1_UTF8STRING)) { in GENERAL_NAME_print()
227 gen->d.otherName->value->value.utf8string->length, in GENERAL_NAME_print()
228 gen->d.otherName->value->value.utf8string->data); in GENERAL_NAME_print()
232 gen->d.otherName->value->value.utf8string->length, in GENERAL_NAME_print()
233 gen->d.otherName->value->value.utf8string->data); in GENERAL_NAME_print()
237 gen->d.otherName->value->value.ia5string->length, in GENERAL_NAME_print()
238 gen->d.otherName->value->value.ia5string->data); in GENERAL_NAME_print()
242 gen->d.otherName->value->value.utf8string->length, in GENERAL_NAME_print()
243 gen->d.otherName->value->value.utf8string->data); in GENERAL_NAME_print()
247 gen->d.otherName->value->value.utf8string->length, in GENERAL_NAME_print()
248 gen->d.otherName->value->value.utf8string->data); in GENERAL_NAME_print()
267 ASN1_STRING_print(out, gen->d.ia5); in GENERAL_NAME_print()
272 ASN1_STRING_print(out, gen->d.ia5); in GENERAL_NAME_print()
277 ASN1_STRING_print(out, gen->d.ia5); in GENERAL_NAME_print()
282 X509_NAME_print_ex(out, gen->d.dirn, 0, XN_FLAG_ONELINE); in GENERAL_NAME_print()
286 tmp = ossl_ipaddr_to_asc(gen->d.ip->data, gen->d.ip->length); in GENERAL_NAME_print()
295 i2a_ASN1_OBJECT(out, gen->d.rid); in GENERAL_NAME_print()
321 GENERAL_NAME *gen = v2i_GENERAL_NAME(method, ctx, cnf); in v2i_issuer_alt() local
323 if (gen == NULL) in v2i_issuer_alt()
325 sk_GENERAL_NAME_push(gens, gen); /* no failure as it was reserved */ in v2i_issuer_alt()
339 GENERAL_NAME *gen; in copy_issuer() local
365 gen = sk_GENERAL_NAME_value(ialt, i); in copy_issuer()
366 sk_GENERAL_NAME_push(gens, gen); /* no failure as it was reserved */ in copy_issuer()
404 GENERAL_NAME *gen; in v2i_subject_alt() local
405 if ((gen = v2i_GENERAL_NAME(method, ctx, cnf)) == NULL) in v2i_subject_alt()
407 sk_GENERAL_NAME_push(gens, gen); /* no failure as it was reserved */ in v2i_subject_alt()
425 GENERAL_NAME *gen = NULL; in copy_email() local
450 if (email == NULL || (gen = GENERAL_NAME_new()) == NULL) { in copy_email()
454 gen->d.ia5 = email; in copy_email()
456 gen->type = GEN_EMAIL; in copy_email()
457 if (!sk_GENERAL_NAME_push(gens, gen)) { in copy_email()
461 gen = NULL; in copy_email()
467 GENERAL_NAME_free(gen); in copy_email()
476 GENERAL_NAME *gen; in v2i_GENERAL_NAMES() local
490 if ((gen = v2i_GENERAL_NAME(method, ctx, cnf)) == NULL) in v2i_GENERAL_NAMES()
492 sk_GENERAL_NAME_push(gens, gen); /* no failure as it was reserved */ in v2i_GENERAL_NAMES()
512 GENERAL_NAME *gen = NULL; in a2i_GENERAL_NAME() local
520 gen = out; in a2i_GENERAL_NAME()
522 gen = GENERAL_NAME_new(); in a2i_GENERAL_NAME()
523 if (gen == NULL) { in a2i_GENERAL_NAME()
544 gen->d.rid = obj; in a2i_GENERAL_NAME()
550 gen->d.ip = a2i_IPADDRESS_NC(value); in a2i_GENERAL_NAME()
552 gen->d.ip = a2i_IPADDRESS(value); in a2i_GENERAL_NAME()
553 if (gen->d.ip == NULL) { in a2i_GENERAL_NAME()
561 if (!do_dirname(gen, value, ctx)) { in a2i_GENERAL_NAME()
568 if (!do_othername(gen, value, ctx)) { in a2i_GENERAL_NAME()
579 if ((gen->d.ia5 = ASN1_IA5STRING_new()) == NULL || in a2i_GENERAL_NAME()
580 !ASN1_STRING_set(gen->d.ia5, (unsigned char *)value, in a2i_GENERAL_NAME()
582 ASN1_IA5STRING_free(gen->d.ia5); in a2i_GENERAL_NAME()
583 gen->d.ia5 = NULL; in a2i_GENERAL_NAME()
589 gen->type = gen_type; in a2i_GENERAL_NAME()
591 return gen; in a2i_GENERAL_NAME()
595 GENERAL_NAME_free(gen); in a2i_GENERAL_NAME()
639 static int do_othername(GENERAL_NAME *gen, const char *value, X509V3_CTX *ctx) in do_othername() argument
646 if ((gen->d.otherName = OTHERNAME_new()) == NULL) in do_othername()
652 ASN1_TYPE_free(gen->d.otherName->value); in do_othername()
653 if ((gen->d.otherName->value = ASN1_generate_v3(p + 1, ctx)) == NULL) in do_othername()
659 gen->d.otherName->type_id = OBJ_txt2obj(objtmp, 0); in do_othername()
661 if (!gen->d.otherName->type_id) in do_othername()
666 OTHERNAME_free(gen->d.otherName); in do_othername()
667 gen->d.otherName = NULL; in do_othername()
671 static int do_dirname(GENERAL_NAME *gen, const char *value, X509V3_CTX *ctx) in do_dirname() argument
689 gen->d.dirn = nm; in do_dirname()