Lines Matching refs:crt
137 static int set_cn(X509 *crt, ...) in set_cn() argument
142 va_start(ap, crt); in set_cn()
157 if (!X509_set_subject_name(crt, n)) in set_cn()
173 static int set_altname(X509 *crt, ...) in set_altname() argument
180 va_start(ap, crt); in set_altname()
212 if (!X509_add1_ext_i2d(crt, NID_subject_alt_name, gens, 0, 0)) in set_altname()
223 static int set_cn1(X509 *crt, const char *name) in set_cn1() argument
225 return set_cn(crt, NID_commonName, name, 0); in set_cn1()
228 static int set_cn_and_email(X509 *crt, const char *name) in set_cn_and_email() argument
230 return set_cn(crt, NID_commonName, name, in set_cn_and_email()
234 static int set_cn2(X509 *crt, const char *name) in set_cn2() argument
236 return set_cn(crt, NID_commonName, "dummy value", in set_cn2()
240 static int set_cn3(X509 *crt, const char *name) in set_cn3() argument
242 return set_cn(crt, NID_commonName, name, in set_cn3()
246 static int set_email1(X509 *crt, const char *name) in set_email1() argument
248 return set_cn(crt, NID_pkcs9_emailAddress, name, 0); in set_email1()
251 static int set_email2(X509 *crt, const char *name) in set_email2() argument
253 return set_cn(crt, NID_pkcs9_emailAddress, "dummy@example.com", in set_email2()
257 static int set_email3(X509 *crt, const char *name) in set_email3() argument
259 return set_cn(crt, NID_pkcs9_emailAddress, name, in set_email3()
263 static int set_email_and_cn(X509 *crt, const char *name) in set_email_and_cn() argument
265 return set_cn(crt, NID_pkcs9_emailAddress, name, in set_email_and_cn()
269 static int set_altname_dns(X509 *crt, const char *name) in set_altname_dns() argument
271 return set_altname(crt, GEN_DNS, name, 0); in set_altname_dns()
274 static int set_altname_email(X509 *crt, const char *name) in set_altname_email() argument
276 return set_altname(crt, GEN_EMAIL, name, 0); in set_altname_email()
303 X509 *crt = NULL; in make_cert() local
305 crt = X509_new(); in make_cert()
306 if (crt == NULL) in make_cert()
308 if (!X509_set_version(crt, 3)) in make_cert()
310 ret = crt; in make_cert()
311 crt = NULL; in make_cert()
334 static void run_cert(X509 *crt, const char *nameincert, in run_cert() argument
345 ret = X509_check_host(crt, name, namelen, 0, NULL); in run_cert()
359 ret = X509_check_host(crt, name, namelen, in run_cert()
374 ret = X509_check_email(crt, name, namelen, 0); in run_cert()
404 bssl::UniquePtr<X509> crt(make_cert()); in TEST() local
405 ASSERT_TRUE(crt); in TEST()
406 ASSERT_TRUE(pfn->fn(crt.get(), *pname)); in TEST()
407 run_cert(crt.get(), *pname, pfn); in TEST()