Lines Matching refs:p12
39 static int write_p12(PKCS12 *p12, const char *outfile);
43 static int check_p12_mac(PKCS12 *p12, const PKCS12_ENC *mac);
148 PKCS12 *p12; in generate_p12() local
160 p12 = PKCS12_add_safes(pb->safes, 0); in generate_p12()
162 p12 = PKCS12_add_safes_ex(pb->safes, 0, test_ctx, test_propq); in generate_p12()
163 if (!TEST_ptr(p12)) { in generate_p12()
175 if (!TEST_true(PKCS12_set_mac(p12, mac->pass, strlen(mac->pass), in generate_p12()
181 i2d_PKCS12_bio(pb->p12bio, p12); in generate_p12()
185 write_p12(p12, pb->filename); in generate_p12()
189 PKCS12_free(p12); in generate_p12()
193 static int write_p12(PKCS12 *p12, const char *outfile) in write_p12() argument
201 if (!TEST_int_eq(i2d_PKCS12_bio(out, p12), 1)) in write_p12()
211 PKCS12 *p12 = NULL; in from_bio_p12() local
215 p12 = PKCS12_init_ex(NID_pkcs7_data, test_ctx, test_propq); in from_bio_p12()
216 if (!TEST_ptr(p12)) in from_bio_p12()
219 p12 = d2i_PKCS12_bio(bio, &p12); in from_bio_p12()
221 if (!TEST_ptr(p12)) in from_bio_p12()
224 if (!TEST_false(PKCS12_mac_present(p12))) in from_bio_p12()
227 if (!check_p12_mac(p12, mac)) in from_bio_p12()
230 return p12; in from_bio_p12()
232 PKCS12_free(p12); in from_bio_p12()
240 PKCS12 *p12 = NULL; in read_p12() local
245 p12 = d2i_PKCS12_bio(in, NULL); in read_p12()
247 if (!TEST_ptr(p12)) in read_p12()
250 if (!TEST_false(PKCS12_mac_present(p12))) in read_p12()
253 if (!check_p12_mac(p12, mac)) in read_p12()
256 return p12; in read_p12()
258 PKCS12_free(p12); in read_p12()
262 static int check_p12_mac(PKCS12 *p12, const PKCS12_ENC *mac) in check_p12_mac() argument
264 return TEST_true(PKCS12_mac_present(p12)) in check_p12_mac()
265 && TEST_true(PKCS12_verify_mac(p12, mac->pass, strlen(mac->pass))); in check_p12_mac()
669 PKCS12 *p12; in start_check_pkcs12() local
674 p12 = from_bio_p12(pb->p12bio, NULL); in start_check_pkcs12()
675 if (!TEST_ptr(p12)) { in start_check_pkcs12()
679 pb->safes = PKCS12_unpack_authsafes(p12); in start_check_pkcs12()
684 PKCS12_free(p12); in start_check_pkcs12()
689 PKCS12 *p12; in start_check_pkcs12_with_mac() local
694 p12 = from_bio_p12(pb->p12bio, mac); in start_check_pkcs12_with_mac()
695 if (!TEST_ptr(p12)) { in start_check_pkcs12_with_mac()
699 pb->safes = PKCS12_unpack_authsafes(p12); in start_check_pkcs12_with_mac()
704 PKCS12_free(p12); in start_check_pkcs12_with_mac()
709 PKCS12 *p12; in start_check_pkcs12_file() local
714 p12 = read_p12(pb->filename, NULL); in start_check_pkcs12_file()
715 if (!TEST_ptr(p12)) { in start_check_pkcs12_file()
719 pb->safes = PKCS12_unpack_authsafes(p12); in start_check_pkcs12_file()
724 PKCS12_free(p12); in start_check_pkcs12_file()
729 PKCS12 *p12; in start_check_pkcs12_file_with_mac() local
734 p12 = read_p12(pb->filename, mac); in start_check_pkcs12_file_with_mac()
735 if (!TEST_ptr(p12)) { in start_check_pkcs12_file_with_mac()
739 pb->safes = PKCS12_unpack_authsafes(p12); in start_check_pkcs12_file_with_mac()
744 PKCS12_free(p12); in start_check_pkcs12_file_with_mac()