-/* $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 $ */
/*-
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;
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);
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);
}
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,
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);
}
}
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,
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) {