summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorJason Wright <jason@cvs.openbsd.org>2000-08-15 01:00:48 +0000
committerJason Wright <jason@cvs.openbsd.org>2000-08-15 01:00:48 +0000
commitc4008adb4a1ee18d12880433219cd8f5e012a7b5 (patch)
tree54bccf5cc15c1fc353eee96ef548be510b24b3e7 /sys/dev
parent03c953e2b7b9cd9b091d500edb22912b0ea187f3 (diff)
- Can't avoid one of those bcopy's so easily (only happens with old ESP
transforms... those with CRD_F_IV_EXPLICIT, so we can take the function call overhead there). - >> instead of << for coffset (auth+enc still isn't working, but this was an obvious bug). - #ifdef UBSEC_DEBUG out the auth-only debugging code
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/pci/ubsec.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/sys/dev/pci/ubsec.c b/sys/dev/pci/ubsec.c
index 9e259af46de..1de2b611a3c 100644
--- a/sys/dev/pci/ubsec.c
+++ b/sys/dev/pci/ubsec.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ubsec.c,v 1.25 2000/08/13 22:07:11 deraadt Exp $ */
+/* $OpenBSD: ubsec.c,v 1.26 2000/08/15 01:00:47 jason Exp $ */
/*
* Copyright (c) 2000 Jason L. Wright (jason@thought.net)
@@ -633,10 +633,9 @@ ubsec_process(crp)
q->q_ctx.pc_flags |= UBS_PKTCTX_ENC_3DES;
if (enccrd->crd_flags & CRD_F_ENCRYPT) {
- if (enccrd->crd_flags & CRD_F_IV_EXPLICIT) {
- q->q_ctx.pc_iv[0] = enccrd->crd_iv[0];
- q->q_ctx.pc_iv[1] = enccrd->crd_iv[1];
- } else {
+ if (enccrd->crd_flags & CRD_F_IV_EXPLICIT)
+ bcopy(enccrd->crd_iv, &q->q_ctx.pc_iv[0], 8);
+ else {
q->q_ctx.pc_iv[0] = ses->ses_iv[0];
q->q_ctx.pc_iv[1] = ses->ses_iv[1];
}
@@ -695,7 +694,7 @@ ubsec_process(crp)
dtheend = stheend = (enccrd)?enccrd->crd_len:maccrd->crd_len;
coffset = 0;
}
- q->q_ctx.pc_offset = coffset << 2;
+ q->q_ctx.pc_offset = coffset >> 2;
q->q_src_l = mbuf2pages(q->q_src_m, &q->q_src_npa, q->q_src_packp,
q->q_src_packl, MAX_SCATTER, &nicealign);
@@ -769,10 +768,12 @@ ubsec_process(crp)
q->q_mcr->mcr_opktbuf.pb_len = 0;
q->q_mcr->mcr_opktbuf.pb_next =
(u_int32_t)vtophys(&q->q_macbuf[0]);
+#ifdef UBSEC_DEBUG
printf("opkt: %x %x %x\n",
q->q_mcr->mcr_opktbuf.pb_addr,
q->q_mcr->mcr_opktbuf.pb_len,
q->q_mcr->mcr_opktbuf.pb_next);
+#endif
} else {
if (!nicealign) {
int totlen, len;