summaryrefslogtreecommitdiff
path: root/sys/arch/i386
diff options
context:
space:
mode:
authorFrederic Cambus <fcambus@cvs.openbsd.org>2017-12-14 09:14:31 +0000
committerFrederic Cambus <fcambus@cvs.openbsd.org>2017-12-14 09:14:31 +0000
commit7dd6cd29e84721a8d7e00d03ab096e234b733c00 (patch)
tree308d7ccfc318661ad7021134a6656fe32a693848 /sys/arch/i386
parent1a83b15492eff53e4573212835822aa54c803d60 (diff)
Change bcopy to memcpy in the i386 version of the VIA PadLock driver.
It was done a while ago in the amd64 version. OK mlarkin@, deraadt@, dlg@
Diffstat (limited to 'sys/arch/i386')
-rw-r--r--sys/arch/i386/i386/via.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/sys/arch/i386/i386/via.c b/sys/arch/i386/i386/via.c
index 3fac9abf5cb..7f2686391ce 100644
--- a/sys/arch/i386/i386/via.c
+++ b/sys/arch/i386/i386/via.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: via.c,v 1.37 2017/05/02 11:47:49 mikeb Exp $ */
+/* $OpenBSD: via.c,v 1.38 2017/12/14 09:14:30 fcambus Exp $ */
/* $NetBSD: machdep.c,v 1.214 1996/11/10 03:16:17 thorpej Exp $ */
/*-
@@ -161,7 +161,7 @@ viac3_crypto_newsession(u_int32_t *sidp, struct cryptoini *cri)
M_NOWAIT);
if (ses == NULL)
return (ENOMEM);
- bcopy(sc->sc_sessions, ses, sesn * sizeof(*ses));
+ memcpy(ses, sc->sc_sessions, sesn * sizeof(*ses));
explicit_bzero(sc->sc_sessions, sesn * sizeof(*ses));
free(sc->sc_sessions, M_DEVBUF, sesn * sizeof(*ses));
sc->sc_sessions = ses;
@@ -370,7 +370,7 @@ viac3_crypto_encdec(struct cryptop *crp, struct cryptodesc *crd,
sc->op_cw[0] = ses->ses_cw0 | C3_CRYPT_CWLO_ENCRYPT;
key = ses->ses_ekey;
if (crd->crd_flags & CRD_F_IV_EXPLICIT)
- bcopy(crd->crd_iv, sc->op_iv, 16);
+ memcpy(sc->op_iv, crd->crd_iv, 16);
else
arc4random_buf(sc->op_iv, 16);
@@ -382,8 +382,8 @@ viac3_crypto_encdec(struct cryptop *crp, struct cryptodesc *crd,
cuio_copyback((struct uio *)crp->crp_buf,
crd->crd_inject, 16, sc->op_iv);
else
- bcopy(sc->op_iv,
- crp->crp_buf + crd->crd_inject, 16);
+ memcpy(crp->crp_buf + crd->crd_inject,
+ sc->op_iv, 16);
if (err)
return (err);
}
@@ -391,7 +391,7 @@ viac3_crypto_encdec(struct cryptop *crp, struct cryptodesc *crd,
sc->op_cw[0] = ses->ses_cw0 | C3_CRYPT_CWLO_DECRYPT;
key = ses->ses_dkey;
if (crd->crd_flags & CRD_F_IV_EXPLICIT)
- bcopy(crd->crd_iv, sc->op_iv, 16);
+ memcpy(sc->op_iv, crd->crd_iv, 16);
else {
if (crp->crp_flags & CRYPTO_F_IMBUF)
m_copydata((struct mbuf *)crp->crp_buf,
@@ -400,8 +400,8 @@ viac3_crypto_encdec(struct cryptop *crp, struct cryptodesc *crd,
cuio_copydata((struct uio *)crp->crp_buf,
crd->crd_inject, 16, sc->op_iv);
else
- bcopy(crp->crp_buf + crd->crd_inject,
- sc->op_iv, 16);
+ memcpy(sc->op_iv,
+ crp->crp_buf + crd->crd_inject, 16);
}
}
@@ -412,7 +412,7 @@ viac3_crypto_encdec(struct cryptop *crp, struct cryptodesc *crd,
cuio_copydata((struct uio *)crp->crp_buf,
crd->crd_skip, crd->crd_len, sc->op_buf);
else
- bcopy(crp->crp_buf + crd->crd_skip, sc->op_buf, crd->crd_len);
+ memcpy(sc->op_buf, crp->crp_buf + crd->crd_skip, crd->crd_len);
sc->op_cw[1] = sc->op_cw[2] = sc->op_cw[3] = 0;
viac3_cbc(&sc->op_cw, sc->op_buf, sc->op_buf, key,
@@ -425,7 +425,7 @@ viac3_crypto_encdec(struct cryptop *crp, struct cryptodesc *crd,
cuio_copyback((struct uio *)crp->crp_buf,
crd->crd_skip, crd->crd_len, sc->op_buf);
else
- bcopy(sc->op_buf, crp->crp_buf + crd->crd_skip,
+ memcpy(crp->crp_buf + crd->crd_skip, sc->op_buf,
crd->crd_len);
if (sc->op_buf != NULL) {