projects
/
oweals
/
openssl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
dev_crypto_md5_copy: return error if allocating to_md->data fails
[oweals/openssl.git]
/
crypto
/
evp
/
p_seal.c
diff --git
a/crypto/evp/p_seal.c
b/crypto/evp/p_seal.c
index 37e547fe7276a1ee748456a5008f4ca34bacde18..e5919b0fbf982320c13672c6ca886c82f2b3f414 100644
(file)
--- a/
crypto/evp/p_seal.c
+++ b/
crypto/evp/p_seal.c
@@
-78,7
+78,7
@@
int EVP_SealInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type, unsigned char **ek
}
if ((npubk <= 0) || !pubk)
return 1;
}
if ((npubk <= 0) || !pubk)
return 1;
- if (
RAND_bytes(key,EVP_MAX_KEY_LENGTH
) <= 0)
+ if (
EVP_CIPHER_CTX_rand_key(ctx, key
) <= 0)
return 0;
if (EVP_CIPHER_CTX_iv_length(ctx))
RAND_pseudo_bytes(iv,EVP_CIPHER_CTX_iv_length(ctx));
return 0;
if (EVP_CIPHER_CTX_iv_length(ctx))
RAND_pseudo_bytes(iv,EVP_CIPHER_CTX_iv_length(ctx));
@@
-87,7
+87,7
@@
int EVP_SealInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type, unsigned char **ek
for (i=0; i<npubk; i++)
{
for (i=0; i<npubk; i++)
{
- ekl[i]=EVP_PKEY_encrypt(ek[i],key,EVP_CIPHER_CTX_key_length(ctx),
+ ekl[i]=EVP_PKEY_encrypt
_old
(ek[i],key,EVP_CIPHER_CTX_key_length(ctx),
pubk[i]);
if (ekl[i] <= 0) return(-1);
}
pubk[i]);
if (ekl[i] <= 0) return(-1);
}
@@
-110,6
+110,7
@@
int EVP_SealFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl)
{
int i;
i = EVP_EncryptFinal_ex(ctx,out,outl);
{
int i;
i = EVP_EncryptFinal_ex(ctx,out,outl);
- EVP_EncryptInit_ex(ctx,NULL,NULL,NULL,NULL);
+ if (i)
+ i = EVP_EncryptInit_ex(ctx,NULL,NULL,NULL,NULL);
return i;
}
return i;
}