diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2001-12-01 23:09:38 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2001-12-01 23:09:38 +0000 |
commit | 6a0dec958428349875d91f89913dd0fda19b6584 (patch) | |
tree | 90d9ec4dc08f87856673278957724cd5e64a265e /crypto/evp | |
parent | 21a85f1977adf092cb6c5862883fd32402791545 (diff) |
Make EVP_SealInit() return the correct value.
Diffstat (limited to 'crypto/evp')
-rw-r--r-- | crypto/evp/p_seal.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/crypto/evp/p_seal.c b/crypto/evp/p_seal.c index ba2dd657ab..5570ca3745 100644 --- a/crypto/evp/p_seal.c +++ b/crypto/evp/p_seal.c @@ -76,9 +76,10 @@ int EVP_SealInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type, unsigned char **ek EVP_CIPHER_CTX_init(ctx); if(!EVP_EncryptInit_ex(ctx,type,NULL,NULL,NULL)) return 0; } - if (npubk <= 0) return(0); + if ((npubk <= 0) || !pubk) + return 1; if (RAND_bytes(key,EVP_MAX_KEY_LENGTH) <= 0) - return(0); + return 0; if (EVP_CIPHER_CTX_iv_length(ctx)) RAND_pseudo_bytes(iv,EVP_CIPHER_CTX_iv_length(ctx)); |