net/mlx5: fix event handler uninstall
[dpdk.git] / drivers / crypto / openssl / rte_openssl_pmd.c
index ea5aac6..6504959 100644 (file)
@@ -1790,11 +1790,14 @@ process_openssl_modinv_op(struct rte_crypto_op *cop,
 
        if (BN_mod_inverse(res, base, sess->u.m.modulus, sess->u.m.ctx)) {
                cop->status = RTE_CRYPTO_OP_STATUS_SUCCESS;
-               op->modinv.base.length = BN_bn2bin(res, op->modinv.base.data);
+               op->modinv.result.length = BN_bn2bin(res, op->modinv.result.data);
        } else {
                cop->status = RTE_CRYPTO_OP_STATUS_ERROR;
        }
 
+       BN_clear(res);
+       BN_clear(base);
+
        return 0;
 }
 
@@ -1814,17 +1817,20 @@ 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.result.length = BN_bn2bin(res, op->modex.result.data);
                cop->status = RTE_CRYPTO_OP_STATUS_SUCCESS;
        } else {
                cop->status = RTE_CRYPTO_OP_STATUS_ERROR;
        }
 
+       BN_clear(res);
+       BN_clear(base);
+
        return 0;
 }
 
@@ -2119,7 +2125,9 @@ cryptodev_openssl_create(const char *name,
                        RTE_CRYPTODEV_FF_CPU_AESNI |
                        RTE_CRYPTODEV_FF_OOP_SGL_IN_LB_OUT |
                        RTE_CRYPTODEV_FF_OOP_LB_IN_LB_OUT |
-                       RTE_CRYPTODEV_FF_ASYMMETRIC_CRYPTO;
+                       RTE_CRYPTODEV_FF_ASYMMETRIC_CRYPTO |
+                       RTE_CRYPTODEV_FF_RSA_PRIV_OP_KEY_EXP |
+                       RTE_CRYPTODEV_FF_RSA_PRIV_OP_KEY_QT;
 
        /* Set vector instructions mode supported */
        internals = dev->data->dev_private;