crypto/openssl: fix modexp

Fixes bad reference of modinv struct in openssl pmd

Fixes: 3e9d6bd447 ("crypto/openssl: add RSA and mod asym operations")
Cc: stable@dpdk.org

Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
Acked-by: Shally Verma <shallyv@marvell.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
This commit is contained in:
Arek Kusztal 2019-02-05 10:13:19 +01:00 committed by Akhil Goyal
parent 990b180290
commit 27323f5385

View File

@ -1817,12 +1817,12 @@ process_openssl_modexp_op(struct rte_crypto_op *cop,
return -1;
}
base = BN_bin2bn((const unsigned char *)op->modinv.base.data,
op->modinv.base.length, base);
base = BN_bin2bn((const unsigned char *)op->modex.base.data,
op->modex.base.length, base);
if (BN_mod_exp(res, base, sess->u.e.exp,
sess->u.e.mod, sess->u.e.ctx)) {
op->modinv.base.length = BN_bn2bin(res, op->modinv.base.data);
op->modex.base.length = BN_bn2bin(res, op->modex.base.data);
cop->status = RTE_CRYPTO_OP_STATUS_SUCCESS;
} else {
cop->status = RTE_CRYPTO_OP_STATUS_ERROR;