Make EVP_SealInit() and EVP_OpenInit() check EVP_EncryptInit() and
EVP_DecryptInit() return values. Update docs.
This commit is contained in:
@@ -71,7 +71,7 @@ int EVP_OpenInit(EVP_CIPHER_CTX *ctx, EVP_CIPHER *type, unsigned char *ek,
|
||||
|
||||
if(type) {
|
||||
EVP_CIPHER_CTX_init(ctx);
|
||||
EVP_DecryptInit(ctx,type,NULL,NULL);
|
||||
if(!EVP_DecryptInit(ctx,type,NULL,NULL)) return 0;
|
||||
}
|
||||
|
||||
if(!priv) return 1;
|
||||
@@ -79,7 +79,6 @@ int EVP_OpenInit(EVP_CIPHER_CTX *ctx, EVP_CIPHER *type, unsigned char *ek,
|
||||
if (priv->type != EVP_PKEY_RSA)
|
||||
{
|
||||
EVPerr(EVP_F_EVP_OPENINIT,EVP_R_PUBLIC_KEY_NOT_RSA);
|
||||
ret= -1;
|
||||
goto err;
|
||||
}
|
||||
|
||||
@@ -89,7 +88,6 @@ int EVP_OpenInit(EVP_CIPHER_CTX *ctx, EVP_CIPHER *type, unsigned char *ek,
|
||||
{
|
||||
/* ERROR */
|
||||
EVPerr(EVP_F_EVP_OPENINIT,ERR_R_MALLOC_FAILURE);
|
||||
ret= -1;
|
||||
goto err;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user