Fix HMACs handling with uio's by not using crp_mac for storing calculated
HMAC. crp_mac is going to be removed.
This commit is contained in:
parent
097f448416
commit
411da41e91
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=158830
@ -2832,8 +2832,9 @@ hifn_callback(struct hifn_softc *sc, struct hifn_command *cmd, u_int8_t *macbuf)
|
||||
if (crp->crp_flags & CRYPTO_F_IMBUF)
|
||||
m_copyback((struct mbuf *)crp->crp_buf,
|
||||
crd->crd_inject, len, macbuf);
|
||||
else if ((crp->crp_flags & CRYPTO_F_IOV) && crp->crp_mac)
|
||||
bcopy((caddr_t)macbuf, crp->crp_mac, len);
|
||||
else if (crp->crp_flags & CRYPTO_F_IOV)
|
||||
cuio_copyback((struct uio *)crp->crp_buf,
|
||||
crd->crd_inject, len, macbuf);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -1591,10 +1591,11 @@ safe_callback(struct safe_softc *sc, struct safe_ringentry *re)
|
||||
crd->crd_inject,
|
||||
sc->sc_sessions[re->re_sesn].ses_mlen,
|
||||
(caddr_t)re->re_sastate.sa_saved_indigest);
|
||||
} else if (crp->crp_flags & CRYPTO_F_IOV && crp->crp_mac) {
|
||||
bcopy((caddr_t)re->re_sastate.sa_saved_indigest,
|
||||
crp->crp_mac,
|
||||
sc->sc_sessions[re->re_sesn].ses_mlen);
|
||||
} else if (crp->crp_flags & CRYPTO_F_IOV) {
|
||||
cuio_copyback((struct uio *)crp->crp_buf,
|
||||
crd->crd_inject,
|
||||
sc->sc_sessions[re->re_sesn].ses_mlen,
|
||||
(caddr_t)re->re_sastate.sa_saved_indigest);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -1622,10 +1622,11 @@ ubsec_callback(struct ubsec_softc *sc, struct ubsec_q *q)
|
||||
crd->crd_inject,
|
||||
sc->sc_sessions[q->q_sesn].ses_mlen,
|
||||
(caddr_t)dmap->d_dma->d_macbuf);
|
||||
else if (crp->crp_flags & CRYPTO_F_IOV && crp->crp_mac)
|
||||
bcopy((caddr_t)dmap->d_dma->d_macbuf,
|
||||
crp->crp_mac,
|
||||
sc->sc_sessions[q->q_sesn].ses_mlen);
|
||||
else if (crp->crp_flags & CRYPTO_F_IOV)
|
||||
cuio_copyback((struct uio *)crp->crp_buf,
|
||||
crd->crd_inject,
|
||||
sc->sc_sessions[q->q_sesn].ses_mlen,
|
||||
(caddr_t)dmap->d_dma->d_macbuf);
|
||||
break;
|
||||
}
|
||||
mtx_lock(&sc->sc_freeqlock);
|
||||
|
Loading…
Reference in New Issue
Block a user