goto err;
ek = OPENSSL_malloc(eklen);
-
- if (ek == NULL) {
- ERR_raise(ERR_LIB_PKCS7, ERR_R_MALLOC_FAILURE);
+ if (ek == NULL)
goto err;
- }
if (EVP_PKEY_encrypt(pctx, ek, &eklen, key, keylen) <= 0)
goto err;
goto err;
ek = OPENSSL_malloc(eklen);
-
- if (ek == NULL) {
- ERR_raise(ERR_LIB_PKCS7, ERR_R_MALLOC_FAILURE);
+ if (ek == NULL)
goto err;
- }
if (EVP_PKEY_decrypt(pctx, ek, &eklen,
ri->enc_key->data, ri->enc_key->length) <= 0
/* Add signing time if not already present */
if (!PKCS7_get_signed_attribute(si, NID_pkcs9_signingTime)) {
if (!PKCS7_add0_attrib_signing_time(si, NULL)) {
- ERR_raise(ERR_LIB_PKCS7, ERR_R_MALLOC_FAILURE);
+ ERR_raise(ERR_LIB_PKCS7, ERR_R_PKCS7_LIB);
return 0;
}
}
return 0;
}
if (!PKCS7_add1_attrib_digest(si, md_data, md_len)) {
- ERR_raise(ERR_LIB_PKCS7, ERR_R_MALLOC_FAILURE);
+ ERR_raise(ERR_LIB_PKCS7, ERR_R_PKCS7_LIB);
return 0;
}
ctx_tmp = EVP_MD_CTX_new();
if (ctx_tmp == NULL) {
- ERR_raise(ERR_LIB_PKCS7, ERR_R_MALLOC_FAILURE);
+ ERR_raise(ERR_LIB_PKCS7, ERR_R_EVP_LIB);
return 0;
}
if (os == NULL) {
os = ASN1_OCTET_STRING_new();
if (os == NULL) {
- ERR_raise(ERR_LIB_PKCS7, ERR_R_MALLOC_FAILURE);
+ ERR_raise(ERR_LIB_PKCS7, ERR_R_ASN1_LIB);
goto err;
}
p7->d.signed_and_enveloped->enc_data->enc_data = os;
if (os == NULL) {
os = ASN1_OCTET_STRING_new();
if (os == NULL) {
- ERR_raise(ERR_LIB_PKCS7, ERR_R_MALLOC_FAILURE);
+ ERR_raise(ERR_LIB_PKCS7, ERR_R_ASN1_LIB);
goto err;
}
p7->d.enveloped->enc_data->enc_data = os;
mctx = EVP_MD_CTX_new();
if (mctx == NULL) {
- ERR_raise(ERR_LIB_PKCS7, ERR_R_MALLOC_FAILURE);
+ ERR_raise(ERR_LIB_PKCS7, ERR_R_EVP_LIB);
goto err;
}
mdc_tmp = EVP_MD_CTX_new();
if (mdc_tmp == NULL) {
- ERR_raise(ERR_LIB_PKCS7, ERR_R_MALLOC_FAILURE);
+ ERR_raise(ERR_LIB_PKCS7, ERR_R_EVP_LIB);
goto err;
}