pbe = PBEPARAM_new();
if (pbe == NULL) {
- ERR_raise(ERR_LIB_ASN1, ERR_R_MALLOC_FAILURE);
+ /* ERR_R_ASN1_LIB, because PBEPARAM_new() is defined in crypto/asn1 */
+ ERR_raise(ERR_LIB_ASN1, ERR_R_ASN1_LIB);
goto err;
}
if (iter <= 0)
iter = PKCS5_DEFAULT_ITER;
if (!ASN1_INTEGER_set(pbe->iter, iter)) {
- ERR_raise(ERR_LIB_ASN1, ERR_R_MALLOC_FAILURE);
+ ERR_raise(ERR_LIB_ASN1, ERR_R_ASN1_LIB);
goto err;
}
if (!saltlen)
goto err;
sstr = OPENSSL_malloc(saltlen);
- if (sstr == NULL) {
- ERR_raise(ERR_LIB_ASN1, ERR_R_MALLOC_FAILURE);
+ if (sstr == NULL)
goto err;
- }
if (salt)
memcpy(sstr, salt, saltlen);
else if (RAND_bytes_ex(ctx, sstr, saltlen, 0) <= 0)
sstr = NULL;
if (!ASN1_item_pack(pbe, ASN1_ITEM_rptr(PBEPARAM), &pbe_str)) {
- ERR_raise(ERR_LIB_ASN1, ERR_R_MALLOC_FAILURE);
+ ERR_raise(ERR_LIB_ASN1, ERR_R_ASN1_LIB);
goto err;
}
X509_ALGOR *ret;
ret = X509_ALGOR_new();
if (ret == NULL) {
- ERR_raise(ERR_LIB_ASN1, ERR_R_MALLOC_FAILURE);
+ ERR_raise(ERR_LIB_ASN1, ERR_R_X509_LIB);
return NULL;
}