Process cipher operation */
| 1833 | |
| 1834 | /** Process cipher operation */ |
| 1835 | static void |
| 1836 | process_openssl_cipher_op(struct openssl_qp *qp, struct rte_crypto_op *op, |
| 1837 | struct openssl_session *sess, struct rte_mbuf *mbuf_src, |
| 1838 | struct rte_mbuf *mbuf_dst) |
| 1839 | { |
| 1840 | uint8_t *dst, *iv; |
| 1841 | int srclen, status; |
| 1842 | uint8_t inplace = (mbuf_src == mbuf_dst) ? 1 : 0; |
| 1843 | |
| 1844 | /* |
| 1845 | * Segmented OOP destination buffer is not supported for encryption/ |
| 1846 | * decryption. In case of des3ctr, even inplace segmented buffers are |
| 1847 | * not supported. |
| 1848 | */ |
| 1849 | if (!rte_pktmbuf_is_contiguous(mbuf_dst) && |
| 1850 | (!inplace || sess->cipher.mode != OPENSSL_CIPHER_LIB)) { |
| 1851 | op->status = RTE_CRYPTO_OP_STATUS_ERROR; |
| 1852 | return; |
| 1853 | } |
| 1854 | |
| 1855 | srclen = op->sym->cipher.data.length; |
| 1856 | dst = rte_pktmbuf_mtod_offset(mbuf_dst, uint8_t *, |
| 1857 | op->sym->cipher.data.offset); |
| 1858 | |
| 1859 | iv = rte_crypto_op_ctod_offset(op, uint8_t *, |
| 1860 | sess->iv.offset); |
| 1861 | |
| 1862 | EVP_CIPHER_CTX *ctx = get_local_cipher_ctx(sess, qp); |
| 1863 | |
| 1864 | if (sess->cipher.mode == OPENSSL_CIPHER_LIB) |
| 1865 | if (sess->cipher.direction == RTE_CRYPTO_CIPHER_OP_ENCRYPT) |
| 1866 | status = process_openssl_cipher_encrypt(mbuf_src, dst, |
| 1867 | op->sym->cipher.data.offset, iv, |
| 1868 | srclen, ctx, inplace); |
| 1869 | else |
| 1870 | status = process_openssl_cipher_decrypt(mbuf_src, dst, |
| 1871 | op->sym->cipher.data.offset, iv, |
| 1872 | srclen, ctx, inplace); |
| 1873 | else |
| 1874 | status = process_openssl_cipher_des3ctr(mbuf_src, dst, |
| 1875 | op->sym->cipher.data.offset, iv, srclen, ctx); |
| 1876 | |
| 1877 | if (status != 0) |
| 1878 | op->status = RTE_CRYPTO_OP_STATUS_ERROR; |
| 1879 | } |
| 1880 | |
| 1881 | /** Process cipher operation */ |
| 1882 | static void |
no test coverage detected