EVP_PKEY **pkey, X509 **cert, STACK **ca)
EVP_PKEY **pkey, X509 **cert, STACK_OF(X509) **ca)
static int parse_pk12 (PKCS12 *p12, const char *pass, int passlen,	     EVP_PKEY **pkey, X509 **cert, STACK **ca){	STACK *asafes, *bags;	int i, bagnid;	PKCS7 *p7;	ASN1_OCTET_STRING *keyid = NULL;	char keymatch = 0;	if (!( asafes = M_PKCS12_unpack_authsafes (p12))) return 0;	for (i = 0; i < sk_num (asafes); i++) {		p7 = (PKCS7 *) sk_value (asafes, i);		bagnid = OBJ_obj2nid (p7->type);		if (bagnid == NID_pkcs7_data) {			bags = M_PKCS12_unpack_p7data (p7);		} else if (bagnid == NID_pkcs7_encrypted) {			bags = M_PKCS12_unpack_p7encdata (p7, pass, passlen);		} else continue;		if (!bags) {			sk_pop_free (asafes, PKCS7_free);			return 0;		}	    	if (!parse_bags(bags, pass, passlen, pkey, cert, ca,							 &keyid, &keymatch)) {			sk_pop_free(bags, PKCS12_SAFEBAG_free);			sk_pop_free(asafes, PKCS7_free);			return 0;		}		sk_pop_free(bags, PKCS12_SAFEBAG_free);	}	sk_pop_free(asafes, PKCS7_free);	if (keyid) M_ASN1_OCTET_STRING_free(keyid);	return 1;}