diff options
| author | markus <> | 2004-04-07 20:42:07 +0000 |
|---|---|---|
| committer | markus <> | 2004-04-07 20:42:07 +0000 |
| commit | 58c08aa241f168c84ce7cc3052454ea59a44eada (patch) | |
| tree | 1806747a3fda66041a998ca63c763fdcf722450e /src/lib/libcrypto/evp/evp_enc.c | |
| parent | 9c1aa44a1eacea897c0432e796b205b8484ff4d2 (diff) | |
| download | openbsd-58c08aa241f168c84ce7cc3052454ea59a44eada.tar.gz openbsd-58c08aa241f168c84ce7cc3052454ea59a44eada.tar.bz2 openbsd-58c08aa241f168c84ce7cc3052454ea59a44eada.zip | |
import openssl-0.9.7d
Diffstat (limited to 'src/lib/libcrypto/evp/evp_enc.c')
| -rw-r--r-- | src/lib/libcrypto/evp/evp_enc.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/lib/libcrypto/evp/evp_enc.c b/src/lib/libcrypto/evp/evp_enc.c index be0758a879..8ea5aa935d 100644 --- a/src/lib/libcrypto/evp/evp_enc.c +++ b/src/lib/libcrypto/evp/evp_enc.c | |||
| @@ -148,7 +148,19 @@ int EVP_CipherInit_ex(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, ENGINE *imp | |||
| 148 | #endif | 148 | #endif |
| 149 | 149 | ||
| 150 | ctx->cipher=cipher; | 150 | ctx->cipher=cipher; |
| 151 | ctx->cipher_data=OPENSSL_malloc(ctx->cipher->ctx_size); | 151 | if (ctx->cipher->ctx_size) |
| 152 | { | ||
| 153 | ctx->cipher_data=OPENSSL_malloc(ctx->cipher->ctx_size); | ||
| 154 | if (!ctx->cipher_data) | ||
| 155 | { | ||
| 156 | EVPerr(EVP_F_EVP_CIPHERINIT, ERR_R_MALLOC_FAILURE); | ||
| 157 | return 0; | ||
| 158 | } | ||
| 159 | } | ||
| 160 | else | ||
| 161 | { | ||
| 162 | ctx->cipher_data = NULL; | ||
| 163 | } | ||
| 152 | ctx->key_len = cipher->key_len; | 164 | ctx->key_len = cipher->key_len; |
| 153 | ctx->flags = 0; | 165 | ctx->flags = 0; |
| 154 | if(ctx->cipher->flags & EVP_CIPH_CTRL_INIT) | 166 | if(ctx->cipher->flags & EVP_CIPH_CTRL_INIT) |
