diff options
Diffstat (limited to 'crypto/evp/e_chacha20_poly1305.c')
-rw-r--r-- | crypto/evp/e_chacha20_poly1305.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/crypto/evp/e_chacha20_poly1305.c b/crypto/evp/e_chacha20_poly1305.c index 26fefd9781..cf4097ba5d 100644 --- a/crypto/evp/e_chacha20_poly1305.c +++ b/crypto/evp/e_chacha20_poly1305.c @@ -345,9 +345,11 @@ static int chacha20_poly1305_ctrl(EVP_CIPHER_CTX *ctx, int type, int arg, case EVP_CTRL_COPY: if (actx) { - if ((((EVP_CIPHER_CTX *)ptr)->cipher_data = - OPENSSL_memdup(actx,sizeof(*actx) + Poly1305_ctx_size())) - == NULL) { + EVP_CIPHER_CTX *dst = (EVP_CIPHER_CTX *)ptr; + + dst->cipher_data = + OPENSSL_memdup(actx, sizeof(*actx) + Poly1305_ctx_size()); + if (dst->cipher_data == NULL) { EVPerr(EVP_F_CHACHA20_POLY1305_CTRL, EVP_R_COPY_ERROR); return 0; } |