add missing evp_cnf.c file
[openssl.git] / crypto / evp / bio_enc.c
index f6ac94c6e1bba4464a6f6c7239cd42bde6fb9dfc..b6efb5fbc4b1f3288e3e6b14f3cbbd238fc45e6d 100644 (file)
@@ -361,8 +361,10 @@ again:
        case BIO_CTRL_DUP:
                dbio=(BIO *)ptr;
                dctx=(BIO_ENC_CTX *)dbio->ptr;
-               memcpy(&(dctx->cipher),&(ctx->cipher),sizeof(ctx->cipher));
-               dbio->init=1;
+               EVP_CIPHER_CTX_init(&dctx->cipher);
+               ret = EVP_CIPHER_CTX_copy(&dctx->cipher,&ctx->cipher);
+               if (ret)
+                       dbio->init=1;
                break;
        default:
                ret=BIO_ctrl(b->next_bio,cmd,num,ptr);