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;
60 gen = sk_GENERAL_NAME_value(gens, i);
66 tmpret = i2v_GENERAL_NAME(method, gen, ret);
80 GENERAL_NAME *gen,
86 switch (gen->type) {
88 switch (OBJ_obj2nid(gen->d.otherName->type_id)) {
90 if (gen->d.otherName->value->type != V_ASN1_UTF8STRING
92 gen->d.otherName->value->value.utf8string->data,
93 gen->d.otherName->value->value.utf8string->length,
98 if (gen->d.otherName->value->type != V_ASN1_UTF8STRING
100 gen->d.otherName->value->value.utf8string->data,
101 gen->d.otherName->value->value.utf8string->length,
106 if (gen->d.otherName->value->type != V_ASN1_IA5STRING
108 gen->d.otherName->value->value.ia5string->data,
109 gen->d.otherName->value->value.ia5string->length,
114 if (gen->d.otherName->value->type != V_ASN1_UTF8STRING
116 gen->d.otherName->value->value.utf8string->data,
117 gen->d.otherName->value->value.utf8string->length,
122 if (gen->d.otherName->value->type != V_ASN1_UTF8STRING
124 gen->d.otherName->value->value.utf8string->data,
125 gen->d.otherName->value->value.utf8string->length,
130 if (OBJ_obj2txt(oline, sizeof(oline), gen->d.otherName->type_id, 0) > 0)
137 if (gen->d.otherName->value->type == V_ASN1_IA5STRING) {
139 gen->d.otherName->value->value.ia5string->data,
140 gen->d.otherName->value->value.ia5string->length,
144 if (gen->d.otherName->value->type == V_ASN1_UTF8STRING) {
146 gen->d.otherName->value->value.utf8string->data,
147 gen->d.otherName->value->value.utf8string->length,
168 if (!x509v3_add_len_value_uchar("email", gen->d.ia5->data,
169 gen->d.ia5->length, &ret))
174 if (!x509v3_add_len_value_uchar("DNS", gen->d.ia5->data,
175 gen->d.ia5->length, &ret))
180 if (!x509v3_add_len_value_uchar("URI", gen->d.ia5->data,
181 gen->d.ia5->length, &ret))
186 if (X509_NAME_oneline(gen->d.dirn, oline, sizeof(oline)) == NULL
192 tmp = ossl_ipaddr_to_asc(gen->d.ip->data, gen->d.ip->length);
199 i2t_ASN1_OBJECT(oline, 256, gen->d.rid);
207 int GENERAL_NAME_print(BIO *out, GENERAL_NAME *gen)
212 switch (gen->type) {
214 nid = OBJ_obj2nid(gen->d.otherName->type_id);
217 && gen->d.otherName->value->type != V_ASN1_IA5STRING)
219 && gen->d.otherName->value->type != V_ASN1_UTF8STRING)) {
227 gen->d.otherName->value->value.utf8string->length,
228 gen->d.otherName->value->value.utf8string->data);
232 gen->d.otherName->value->value.utf8string->length,
233 gen->d.otherName->value->value.utf8string->data);
237 gen->d.otherName->value->value.ia5string->length,
238 gen->d.otherName->value->value.ia5string->data);
242 gen->d.otherName->value->value.utf8string->length,
243 gen->d.otherName->value->value.utf8string->data);
247 gen->d.otherName->value->value.utf8string->length,
248 gen->d.otherName->value->value.utf8string->data);
267 ASN1_STRING_print(out, gen->d.ia5);
272 ASN1_STRING_print(out, gen->d.ia5);
277 ASN1_STRING_print(out, gen->d.ia5);
282 X509_NAME_print_ex(out, gen->d.dirn, 0, XN_FLAG_ONELINE);
286 tmp = ossl_ipaddr_to_asc(gen->d.ip->data, gen->d.ip->length);
295 i2a_ASN1_OBJECT(out, gen->d.rid);
322 GENERAL_NAME *gen = v2i_GENERAL_NAME(method, ctx, cnf);
324 if (gen == NULL)
326 sk_GENERAL_NAME_push(gens, gen); /* no failure as it was reserved */
340 GENERAL_NAME *gen;
366 gen = sk_GENERAL_NAME_value(ialt, i);
367 sk_GENERAL_NAME_push(gens, gen); /* no failure as it was reserved */
405 GENERAL_NAME *gen;
406 if ((gen = v2i_GENERAL_NAME(method, ctx, cnf)) == NULL)
408 sk_GENERAL_NAME_push(gens, gen); /* no failure as it was reserved */
426 GENERAL_NAME *gen = NULL;
451 if (email == NULL || (gen = GENERAL_NAME_new()) == NULL) {
455 gen->d.ia5 = email;
457 gen->type = GEN_EMAIL;
458 if (!sk_GENERAL_NAME_push(gens, gen)) {
462 gen = NULL;
468 GENERAL_NAME_free(gen);
477 GENERAL_NAME *gen;
492 if ((gen = v2i_GENERAL_NAME(method, ctx, cnf)) == NULL)
494 sk_GENERAL_NAME_push(gens, gen); /* no failure as it was reserved */
514 GENERAL_NAME *gen = NULL;
522 gen = out;
524 gen = GENERAL_NAME_new();
525 if (gen == NULL) {
546 gen->d.rid = obj;
552 gen->d.ip = a2i_IPADDRESS_NC(value);
554 gen->d.ip = a2i_IPADDRESS(value);
555 if (gen->d.ip == NULL) {
563 if (!do_dirname(gen, value, ctx)) {
570 if (!do_othername(gen, value, ctx)) {
581 if ((gen->d.ia5 = ASN1_IA5STRING_new()) == NULL ||
582 !ASN1_STRING_set(gen->d.ia5, (unsigned char *)value,
584 ASN1_IA5STRING_free(gen->d.ia5);
585 gen->d.ia5 = NULL;
591 gen->type = gen_type;
593 return gen;
597 GENERAL_NAME_free(gen);
641 static int do_othername(GENERAL_NAME *gen, const char *value, X509V3_CTX *ctx)
648 if ((gen->d.otherName = OTHERNAME_new()) == NULL)
654 ASN1_TYPE_free(gen->d.otherName->value);
655 if ((gen->d.otherName->value = ASN1_generate_v3(p + 1, ctx)) == NULL)
661 gen->d.otherName->type_id = OBJ_txt2obj(objtmp, 0);
663 if (!gen->d.otherName->type_id)
668 OTHERNAME_free(gen->d.otherName);
669 gen->d.otherName = NULL;
673 static int do_dirname(GENERAL_NAME *gen, const char *value, X509V3_CTX *ctx)
691 gen->d.dirn = nm;