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:
Pawel Jakub Dawidek 2006-05-22 16:18:21 +00:00
parent 097f448416
commit 411da41e91
3 changed files with 13 additions and 10 deletions

View File

@ -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;
}
}

View File

@ -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;
}

View File

@ -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);