提交 f61c5ca6 编写于 作者: I Iaroslav Gridin 提交者: Richard Levitte

use EVP_CIPHER_CTX_ functions instead of accessing EVP_CIPHER_CTX internals

by levitte
Reviewed-by: NRich Salz <rsalz@openssl.org>
Reviewed-by: NRichard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1784)
上级 349b653a
...@@ -534,12 +534,13 @@ static int cryptodev_cleanup(EVP_CIPHER_CTX *ctx) ...@@ -534,12 +534,13 @@ static int cryptodev_cleanup(EVP_CIPHER_CTX *ctx)
static int cryptodev_cipher_ctrl(EVP_CIPHER_CTX *ctx, int type, int p1, void *p2) static int cryptodev_cipher_ctrl(EVP_CIPHER_CTX *ctx, int type, int p1, void *p2)
{ {
struct dev_crypto_state *state = ctx->cipher_data; struct dev_crypto_state *state = EVP_CIPHER_CTX_get_cipher_data(ctx);
struct session_op *sess = &state->d_sess; struct session_op *sess = &state->d_sess;
if (type == EVP_CTRL_COPY) { if (type == EVP_CTRL_COPY) {
EVP_CIPHER_CTX *out = p2; EVP_CIPHER_CTX *out = p2;
return cryptodev_init_key(out, sess->key, ctx->iv, 0); return cryptodev_init_key(out, (unsigned char *)sess->key,
EVP_CIPHER_CTX_iv(ctx), 0);
} }
return 0; return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册