Lines Matching refs:ret

41     int ret;  in test_name()  local
43 ret = hx509_parse_name(context, name, &n); in test_name()
44 if (ret) in test_name()
47 ret = hx509_name_to_string(n, &s); in test_name()
48 if (ret) in test_name()
77 int ret; in test_expand() local
81 ret = hx509_parse_name(context, name, &n); in test_expand()
82 if (ret) in test_expand()
85 ret = hx509_name_expand(context, n, env); in test_expand()
87 if (ret) in test_expand()
90 ret = hx509_name_to_string(n, &s); in test_expand()
92 if (ret) in test_expand()
95 ret = strcmp(s, expected) != 0; in test_expand()
97 if (ret) in test_expand()
299 int ret; in compare_subject() local
301 ret = hx509_cert_get_subject(c1, &n1); in compare_subject()
302 if (ret) return 1; in compare_subject()
303 ret = hx509_cert_get_subject(c2, &n2); in compare_subject()
304 if (ret) return 1; in compare_subject()
316 int ret; in test_compare() local
322 ret = hx509_cert_init_data(context, certdata1, sizeof(certdata1) - 1, &c1); in test_compare()
323 if (ret) return 1; in test_compare()
325 ret = hx509_cert_init_data(context, certdata2, sizeof(certdata2) - 1, &c2); in test_compare()
326 if (ret) return 1; in test_compare()
328 ret = hx509_cert_init_data(context, certdata3, sizeof(certdata3) - 1, &c3); in test_compare()
329 if (ret) return 1; in test_compare()
331 ret = compare_subject(c1, c1, &l0); in test_compare()
332 if (ret) return 1; in test_compare()
333 ret = compare_subject(c1, c2, &l1); in test_compare()
334 if (ret) return 1; in test_compare()
335 ret = compare_subject(c1, c3, &l2); in test_compare()
336 if (ret) return 1; in test_compare()
337 ret = compare_subject(c2, c3, &l3); in test_compare()
338 if (ret) return 1; in test_compare()
357 int ret = 0; in main() local
359 ret = hx509_context_init(&context); in main()
360 if (ret) in main()
361 errx(1, "hx509_context_init failed with %d", ret); in main()
363 ret += test_name(context, "CN=foo,C=SE"); in main()
364 ret += test_name(context, "CN=foo,CN=kaka,CN=FOO,DC=ad1,C=SE"); in main()
365 ret += test_name(context, "1.2.3.4=foo,C=SE"); in main()
366 ret += test_name_fail(context, "="); in main()
367 ret += test_name_fail(context, "CN=foo,=foo"); in main()
368 ret += test_name_fail(context, "CN=foo,really-unknown-type=foo"); in main()
370 ret += test_expand(context, "UID=${uid},C=SE", "UID=lha,C=SE"); in main()
371 ret += test_expand(context, "UID=foo${uid},C=SE", "UID=foolha,C=SE"); in main()
372 ret += test_expand(context, "UID=${uid}bar,C=SE", "UID=lhabar,C=SE"); in main()
373 ret += test_expand(context, "UID=f${uid}b,C=SE", "UID=flhab,C=SE"); in main()
374 ret += test_expand(context, "UID=${uid}${uid},C=SE", "UID=lhalha,C=SE"); in main()
375 ret += test_expand(context, "UID=${uid}{uid},C=SE", "UID=lha{uid},C=SE"); in main()
377 ret += test_compare(context); in main()
381 return ret; in main()