ASN1_STRING *cstr;
gen = sk_GENERAL_NAME_value(gens, i);
- if (gen->type != check_type)
- continue;
+ if ((gen->type == GEN_OTHERNAME) && (check_type == GEN_EMAIL)) {
+ if (OBJ_obj2nid(gen->d.otherName->type_id) ==
+ NID_id_on_SmtpUTF8Mailbox) {
+ san_present = 1;
+ cstr = gen->d.otherName->value->value.utf8string;
+
+ /* Positive on success, negative on error! */
+ if ((rv = do_check_string(cstr, 0, equal, flags,
+ chk, chklen, peername)) != 0)
+ break;
+ } else
+ continue;
+ } else {
+ if ((gen->type != check_type) && (gen->type != GEN_OTHERNAME))
+ continue;
+ }
san_present = 1;
if (check_type == GEN_EMAIL)
cstr = gen->d.rfc822Name;