if (!param || (param->type = V_ASN1_SEQUENCE) ||
if (!param || (param->type != V_ASN1_SEQUENCE) ||
int PKCS12_PBE_keyivgen (EVP_CIPHER_CTX *ctx, const char *pass, int passlen,		ASN1_TYPE *param, EVP_CIPHER *cipher, EVP_MD *md, int en_de){	PBEPARAM *pbe;	int saltlen, iter;	unsigned char *salt, *pbuf;	unsigned char key[EVP_MAX_KEY_LENGTH], iv[EVP_MAX_IV_LENGTH];	/* Extract useful info from parameter */	pbuf = param->value.sequence->data;	if (!param || (param->type = V_ASN1_SEQUENCE) ||	   !(pbe = d2i_PBEPARAM (NULL, &pbuf, param->value.sequence->length))) {		EVPerr(PKCS12_F_PKCS12_PBE_KEYIVGEN,EVP_R_DECODE_ERROR);		return 0;	}	if (!pbe->iter) iter = 1;	else iter = ASN1_INTEGER_get (pbe->iter);	salt = pbe->salt->data;	saltlen = pbe->salt->length;	if (!PKCS12_key_gen (pass, passlen, salt, saltlen, PKCS12_KEY_ID,			     iter, EVP_CIPHER_key_length(cipher), key, md)) {		PKCS12err(PKCS12_F_PKCS12_PBE_KEYIVGEN,PKCS12_R_KEY_GEN_ERROR);		PBEPARAM_free(pbe);		return 0;	}	if (!PKCS12_key_gen (pass, passlen, salt, saltlen, PKCS12_IV_ID,				iter, EVP_CIPHER_iv_length(cipher), iv, md)) {		PKCS12err(PKCS12_F_PKCS12_PBE_KEYIVGEN,PKCS12_R_IV_GEN_ERROR);		PBEPARAM_free(pbe);		return 0;	}	PBEPARAM_free(pbe);	EVP_CipherInit(ctx, cipher, key, iv, en_de);	memset(key, 0, EVP_MAX_KEY_LENGTH);	memset(iv, 0, EVP_MAX_IV_LENGTH);	return 1;}