Lines Matching refs:bag

36 static int add_attributes(PKCS12_SAFEBAG *bag, const PKCS12_ATTR *attrs);
341 static int add_attributes(PKCS12_SAFEBAG *bag, const PKCS12_ATTR *attr) in add_attributes() argument
357 if (!TEST_true(PKCS12_add_friendlyname(bag, p_attr->value, -1))) in add_attributes()
360 if (!TEST_true(PKCS12_add_localkeyid(bag, (unsigned char *)p_attr->value, in add_attributes()
364 attrs = (STACK_OF(X509_ATTRIBUTE)*)PKCS12_SAFEBAG_get0_attrs(bag); in add_attributes()
367 PKCS12_SAFEBAG_set0_attrs(bag, attrs); in add_attributes()
371 if (!TEST_true(PKCS12_add1_attr_by_txt(bag, p_attr->oid, MBSTRING_ASC, in add_attributes()
386 PKCS12_SAFEBAG *bag = NULL; in add_certbag() local
403 bag = PKCS12_add_cert(&pb->bags, cert); in add_certbag()
404 if (!TEST_ptr(bag)) { in add_certbag()
409 if (!TEST_true(add_attributes(bag, attrs))) { in add_certbag()
420 PKCS12_SAFEBAG *bag = NULL; in add_keybag() local
435 bag = PKCS12_add_key(&pb->bags, pkey, 0 /*keytype*/, enc->iter, enc->nid, enc->pass); in add_keybag()
437 bag = PKCS12_add_key_ex(&pb->bags, pkey, 0 /*keytype*/, enc->iter, enc->nid, enc->pass, in add_keybag()
439 if (!TEST_ptr(bag)) { in add_keybag()
443 if (!add_attributes(bag, attrs)) in add_keybag()
452 PKCS12_SAFEBAG *bag = NULL; in add_secretbag() local
459 bag = PKCS12_add_secret(&pb->bags, secret_nid, (const unsigned char *)secret, strlen(secret)); in add_secretbag()
460 if (!TEST_ptr(bag)) { in add_secretbag()
464 if (!add_attributes(bag, attrs)) in add_secretbag()
554 const PKCS12_SAFEBAG *bag; in check_certbag() local
559 bag = sk_PKCS12_SAFEBAG_value(pb->bags, pb->bag_idx++); in check_certbag()
560 if (!TEST_ptr(bag)) { in check_certbag()
564 if (!check_attrs(PKCS12_SAFEBAG_get0_attrs(bag), attrs) in check_certbag()
565 || !TEST_int_eq(PKCS12_SAFEBAG_get_nid(bag), NID_certBag) in check_certbag()
566 || !TEST_int_eq(PKCS12_SAFEBAG_get_bag_nid(bag), NID_x509Certificate)) { in check_certbag()
570 x509 = PKCS12_SAFEBAG_get1_cert(bag); in check_certbag()
590 const PKCS12_SAFEBAG *bag; in check_keybag() local
595 bag = sk_PKCS12_SAFEBAG_value(pb->bags, pb->bag_idx++); in check_keybag()
596 if (!TEST_ptr(bag)) { in check_keybag()
601 if (!check_attrs(PKCS12_SAFEBAG_get0_attrs(bag), attrs)) { in check_keybag()
606 switch (PKCS12_SAFEBAG_get_nid(bag)) { in check_keybag()
608 p8c = PKCS12_SAFEBAG_get0_p8inf(bag); in check_keybag()
617 p8 = PKCS12_decrypt_skey(bag, enc->pass, strlen(enc->pass)); in check_keybag()
619 p8 = PKCS12_decrypt_skey_ex(bag, enc->pass, strlen(enc->pass), test_ctx, test_propq); in check_keybag()
648 const PKCS12_SAFEBAG *bag; in check_secretbag() local
653 bag = sk_PKCS12_SAFEBAG_value(pb->bags, pb->bag_idx++); in check_secretbag()
654 if (!TEST_ptr(bag)) { in check_secretbag()
659 if (!check_attrs(PKCS12_SAFEBAG_get0_attrs(bag), attrs) in check_secretbag()
660 || !TEST_int_eq(PKCS12_SAFEBAG_get_nid(bag), NID_secretBag) in check_secretbag()
661 || !TEST_int_eq(PKCS12_SAFEBAG_get_bag_nid(bag), secret_nid) in check_secretbag()
662 || !TEST_true(check_asn1_string(PKCS12_SAFEBAG_get0_bag_obj(bag), secret))) in check_secretbag()