From 411da41e91d63317cde53902312fcd7322811ab4 Mon Sep 17 00:00:00 2001 From: Pawel Jakub Dawidek Date: Mon, 22 May 2006 16:18:21 +0000 Subject: [PATCH] Fix HMACs handling with uio's by not using crp_mac for storing calculated HMAC. crp_mac is going to be removed. --- sys/dev/hifn/hifn7751.c | 5 +++-- sys/dev/safe/safe.c | 9 +++++---- sys/dev/ubsec/ubsec.c | 9 +++++---- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/sys/dev/hifn/hifn7751.c b/sys/dev/hifn/hifn7751.c index 14e47609fbc1..7dddd53bb6c4 100644 --- a/sys/dev/hifn/hifn7751.c +++ b/sys/dev/hifn/hifn7751.c @@ -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; } } diff --git a/sys/dev/safe/safe.c b/sys/dev/safe/safe.c index 4475f5012397..0c0b6efbed25 100644 --- a/sys/dev/safe/safe.c +++ b/sys/dev/safe/safe.c @@ -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; } diff --git a/sys/dev/ubsec/ubsec.c b/sys/dev/ubsec/ubsec.c index 4a5656073d1c..151cd02fe475 100644 --- a/sys/dev/ubsec/ubsec.c +++ b/sys/dev/ubsec/ubsec.c @@ -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);