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/ubsec | |
| parent | 8cbde414199b0d2fd91c8eb770e74ec23852a9d4 (diff) | |
Notes
Diffstat (limited to 'sys/dev/ubsec')
| -rw-r--r-- | sys/dev/ubsec/ubsec.c | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/sys/dev/ubsec/ubsec.c b/sys/dev/ubsec/ubsec.c index e4b324e05f86..bb5c1fe74c94 100644 --- a/sys/dev/ubsec/ubsec.c +++ b/sys/dev/ubsec/ubsec.c @@ -1043,15 +1043,7 @@ ubsec_process(device_t dev, struct cryptop *crp, int hint) ctx.pc_flags |= htole16(UBS_PKTCTX_ENC_3DES); - if (crp->crp_flags & CRYPTO_F_IV_GENERATE) { - arc4rand(ctx.pc_iv, csp->csp_ivlen, 0); - crypto_copyback(crp, crp->crp_iv_start, - csp->csp_ivlen, ctx.pc_iv); - } else if (crp->crp_flags & CRYPTO_F_IV_SEPARATE) - memcpy(ctx.pc_iv, crp->crp_iv, csp->csp_ivlen); - else - crypto_copydata(crp, crp->crp_iv_start, csp->csp_ivlen, - ctx.pc_iv); + crypto_read_iv(crp, ctx.pc_iv); if (!CRYPTO_OP_IS_ENCRYPT(crp->crp_op)) { ctx.pc_flags |= htole16(UBS_PKTCTX_INBOUND); |
