summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2001-06-14 23:55:03 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2001-06-14 23:55:03 +0000
commit486011ad768035c0fafb58adf9c3f51ebd966aab (patch)
treec769606bd6e68bab5d6972b8bd6c6c47c68a59d1 /sys
parent253096d2c4af92bcd795d46a882a8f764d9f081b (diff)
hackish auto-IV mode for IOV operations
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/pci/hifn7751.c20
-rw-r--r--sys/dev/pci/ubsec.c24
2 files changed, 20 insertions, 24 deletions
diff --git a/sys/dev/pci/hifn7751.c b/sys/dev/pci/hifn7751.c
index e6e68cc2f42..8a77196fb34 100644
--- a/sys/dev/pci/hifn7751.c
+++ b/sys/dev/pci/hifn7751.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hifn7751.c,v 1.68 2001/06/14 23:51:58 deraadt Exp $ */
+/* $OpenBSD: hifn7751.c,v 1.69 2001/06/14 23:55:02 deraadt Exp $ */
/*
* Invertex AEON / Hi/fn 7751 driver
@@ -1408,11 +1408,10 @@ hifn_process(crp)
m_copyback(cmd->src_m, enccrd->crd_inject,
HIFN_IV_LENGTH, cmd->iv);
else if (crp->crp_flags & CRYPTO_F_IOV) {
- if (crp->crp_iv == NULL) {
- err = EINVAL;
- goto errout;
- }
- bcopy(crp->crp_iv, cmd->iv, 8);
+ if (crp->crp_iv == NULL)
+ bzero(cmd->iv, 8);
+ else
+ bcopy(crp->crp_iv, cmd->iv, 8);
}
}
} else {
@@ -1422,11 +1421,10 @@ hifn_process(crp)
m_copydata(cmd->src_m, enccrd->crd_inject,
HIFN_IV_LENGTH, cmd->iv);
else if (crp->crp_flags & CRYPTO_F_IOV) {
- if (crp->crp_iv == NULL) {
- err = EINVAL;
- goto errout;
- }
- bcopy(crp->crp_iv, cmd->iv, 8);
+ if (crp->crp_iv == NULL)
+ bzero(cmd->iv, 8);
+ else
+ bcopy(crp->crp_iv, cmd->iv, 8);
}
}
diff --git a/sys/dev/pci/ubsec.c b/sys/dev/pci/ubsec.c
index 25179e1ad96..3b877cd353c 100644
--- a/sys/dev/pci/ubsec.c
+++ b/sys/dev/pci/ubsec.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ubsec.c,v 1.56 2001/06/12 15:40:33 niklas Exp $ */
+/* $OpenBSD: ubsec.c,v 1.57 2001/06/14 23:55:02 deraadt Exp $ */
/*
* Copyright (c) 2000 Jason L. Wright (jason@thought.net)
@@ -698,13 +698,11 @@ ubsec_process(crp)
m_copyback(q->q_src_m, enccrd->crd_inject,
8, (caddr_t)ctx.pc_iv);
else if (crp->crp_flags & CRYPTO_F_IOV) {
- if (crp->crp_iv == NULL) {
- err = EINVAL;
- goto errout;
- }
- bcopy(crp->crp_iv,
- (caddr_t)ctx.pc_iv, 8);
- }
+ if (crp->crp_iv == NULL)
+ bzero((caddr_t)ctx.pc_iv, 8);
+ else
+ bcopy(crp->crp_iv,
+ (caddr_t)ctx.pc_iv, 8);
}
} else {
ctx.pc_flags |= UBS_PKTCTX_INBOUND;
@@ -715,11 +713,11 @@ ubsec_process(crp)
m_copydata(q->q_src_m, enccrd->crd_inject,
8, (caddr_t)ctx.pc_iv);
else if (crp->crp_flags & CRYPTO_F_IOV) {
- if (crp->crp_iv == NULL) {
- err = EINVAL;
- goto errout;
- }
- bcopy(crp->crp_iv, (caddr_t)ctx.pc_iv, 8);
+ if (crp->crp_iv == NULL)
+ bzero((caddr_t)ctx.pc_iv, 8);
+ else
+ bcopy(crp->crp_iv,
+ (caddr_t)ctx.pc_iv, 8);
}
}