diff options
| author | John Baldwin <jhb@FreeBSD.org> | 2020-04-20 22:24:49 +0000 |
|---|---|---|
| committer | John Baldwin <jhb@FreeBSD.org> | 2020-04-20 22:24:49 +0000 |
| commit | 29fe41ddd714bae92a09fd4098fad614945bedf5 (patch) | |
| tree | 2692b7560f3c90d27ecdfe4de9a81c2c00514d15 /sys/dev/cesa | |
| parent | 8cbde414199b0d2fd91c8eb770e74ec23852a9d4 (diff) | |
Notes
Diffstat (limited to 'sys/dev/cesa')
| -rw-r--r-- | sys/dev/cesa/cesa.c | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/sys/dev/cesa/cesa.c b/sys/dev/cesa/cesa.c index d4e056d2a09b..44cf77a8acc0 100644 --- a/sys/dev/cesa/cesa.c +++ b/sys/dev/cesa/cesa.c @@ -1791,17 +1791,8 @@ cesa_process(device_t dev, struct cryptop *crp, int hint) CESA_LOCK(sc, sessions); cesa_sync_desc(sc, BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); - if (csp->csp_cipher_alg != 0) { - if (crp->crp_flags & CRYPTO_F_IV_GENERATE) { - arc4rand(cr->cr_csd->csd_iv, csp->csp_ivlen, 0); - crypto_copyback(crp, crp->crp_iv_start, csp->csp_ivlen, - cr->cr_csd->csd_iv); - } else if (crp->crp_flags & CRYPTO_F_IV_SEPARATE) - memcpy(cr->cr_csd->csd_iv, crp->crp_iv, csp->csp_ivlen); - else - crypto_copydata(crp, crp->crp_iv_start, csp->csp_ivlen, - cr->cr_csd->csd_iv); - } + if (csp->csp_cipher_alg != 0) + crypto_read_iv(crp, cr->cr_csd->csd_iv); if (crp->crp_cipher_key != NULL) { memcpy(cs->cs_key, crp->crp_cipher_key, |
