static void run_cert(X509 *crt, const char *nameincert,
		     const struct set_name_fn *fn)
	{
	const char *const *pname = names;
	while (*pname)
		{
		int samename = strcasecmp(nameincert, *pname) == 0;
		size_t namelen = strlen(*pname);
		char *name = malloc(namelen);
		int match, ret;
		memcpy(name, *pname, namelen);
		ret = X509_check_host(crt, (const unsigned char *)name,
				      namelen, 0);
		match = -1;
		if (ret < 0)
			{
			fprintf(stderr, "internal error in X509_check_host");
			++errors;
			}
		else if (fn->host)
			{
			if (ret == 1 && !samename)
				match = 1;
			if (ret == 0 && samename)
				match = 0;
			}
		else if (ret == 1)
			match = 1;
		check_message(fn, "host", nameincert, match, *pname);
		ret = X509_check_host(crt, (const unsigned char *)name,
				      namelen, X509_CHECK_FLAG_NO_WILDCARDS);
		match = -1;
		if (ret < 0)
			{
			fprintf(stderr, "internal error in X509_check_host");
			++errors;
			}
		else if (fn->host)
			{
			if (ret == 1 && !samename)
				match = 1;
			if (ret == 0 && samename)
				match = 0;
			}
		else if (ret == 1)
			match = 1;
		check_message(fn, "host-no-wildcards",
			      nameincert, match, *pname);
		ret = X509_check_email(crt, (const unsigned char *)name,
				       namelen, 0);
		match = -1;
		if (fn->email)
			{
			if (ret && !samename)
				match = 1;
			if (!ret && samename && strchr(nameincert, '@') != NULL)
				match = 0;
			}
		else if (ret)
			match = 1;
		check_message(fn, "email", nameincert, match, *pname);
		++pname;
		free(name);
		}
	}
['static void run_cert(X509 *crt, const char *nameincert,\n\t\t     const struct set_name_fn *fn)\n\t{\n\tconst char *const *pname = names;\n\twhile (*pname)\n\t\t{\n\t\tint samename = strcasecmp(nameincert, *pname) == 0;\n\t\tsize_t namelen = strlen(*pname);\n\t\tchar *name = malloc(namelen);\n\t\tint match, ret;\n\t\tmemcpy(name, *pname, namelen);\n\t\tret = X509_check_host(crt, (const unsigned char *)name,\n\t\t\t\t      namelen, 0);\n\t\tmatch = -1;\n\t\tif (ret < 0)\n\t\t\t{\n\t\t\tfprintf(stderr, "internal error in X509_check_host");\n\t\t\t++errors;\n\t\t\t}\n\t\telse if (fn->host)\n\t\t\t{\n\t\t\tif (ret == 1 && !samename)\n\t\t\t\tmatch = 1;\n\t\t\tif (ret == 0 && samename)\n\t\t\t\tmatch = 0;\n\t\t\t}\n\t\telse if (ret == 1)\n\t\t\tmatch = 1;\n\t\tcheck_message(fn, "host", nameincert, match, *pname);\n\t\tret = X509_check_host(crt, (const unsigned char *)name,\n\t\t\t\t      namelen, X509_CHECK_FLAG_NO_WILDCARDS);\n\t\tmatch = -1;\n\t\tif (ret < 0)\n\t\t\t{\n\t\t\tfprintf(stderr, "internal error in X509_check_host");\n\t\t\t++errors;\n\t\t\t}\n\t\telse if (fn->host)\n\t\t\t{\n\t\t\tif (ret == 1 && !samename)\n\t\t\t\tmatch = 1;\n\t\t\tif (ret == 0 && samename)\n\t\t\t\tmatch = 0;\n\t\t\t}\n\t\telse if (ret == 1)\n\t\t\tmatch = 1;\n\t\tcheck_message(fn, "host-no-wildcards",\n\t\t\t      nameincert, match, *pname);\n\t\tret = X509_check_email(crt, (const unsigned char *)name,\n\t\t\t\t       namelen, 0);\n\t\tmatch = -1;\n\t\tif (fn->email)\n\t\t\t{\n\t\t\tif (ret && !samename)\n\t\t\t\tmatch = 1;\n\t\t\tif (!ret && samename && strchr(nameincert, \'@\') != NULL)\n\t\t\t\tmatch = 0;\n\t\t\t}\n\t\telse if (ret)\n\t\t\tmatch = 1;\n\t\tcheck_message(fn, "email", nameincert, match, *pname);\n\t\t++pname;\n\t\tfree(name);\n\t\t}\n\t}']