projects
/
oweals
/
openssl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
rc4/asm/rc4-586.pl: allow for 386-only build.
[oweals/openssl.git]
/
crypto
/
evp
/
p_seal.c
diff --git
a/crypto/evp/p_seal.c
b/crypto/evp/p_seal.c
index 5570ca3745648aeecdd8c5515bfa671e3095ae73..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);
}
@@
-106,8
+106,11
@@
int inl;
}
*/
}
*/
-
void
EVP_SealFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl)
+
int
EVP_SealFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl)
{
{
- EVP_EncryptFinal_ex(ctx,out,outl);
- EVP_EncryptInit_ex(ctx,NULL,NULL,NULL,NULL);
+ int i;
+ i = EVP_EncryptFinal_ex(ctx,out,outl);
+ if (i)
+ i = EVP_EncryptInit_ex(ctx,NULL,NULL,NULL,NULL);
+ return i;
}
}