summaryrefslogtreecommitdiffstats
path: root/sys/crypto/cryptodev.c
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2005-08-18 13:10:02 +0000
committerderaadt <deraadt@openbsd.org>2005-08-18 13:10:02 +0000
commit21a35baa53eb66b2c7441e60eee533f5e56f7c93 (patch)
treedcec9b264393b4839be54bc8ff94f558ff5d966e /sys/crypto/cryptodev.c
parentafterboot(8) MLINK to faq(8) is pointless; (diff)
downloadwireguard-openbsd-21a35baa53eb66b2c7441e60eee533f5e56f7c93.tar.xz
wireguard-openbsd-21a35baa53eb66b2c7441e60eee533f5e56f7c93.zip
do not allow 0-length transforms; from freebsd
Diffstat (limited to 'sys/crypto/cryptodev.c')
-rw-r--r--sys/crypto/cryptodev.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/crypto/cryptodev.c b/sys/crypto/cryptodev.c
index bd1e888d368..95c5703a825 100644
--- a/sys/crypto/cryptodev.c
+++ b/sys/crypto/cryptodev.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cryptodev.c,v 1.63 2005/05/25 05:47:53 markus Exp $ */
+/* $OpenBSD: cryptodev.c,v 1.64 2005/08/18 13:10:02 deraadt Exp $ */
/*
* Copyright (c) 2001 Theo de Raadt
@@ -311,8 +311,9 @@ cryptodev_op(struct csession *cse, struct crypt_op *cop, struct proc *p)
if (cop->len > 64*1024-4)
return (E2BIG);
- if (cse->txform && (cop->len % cse->txform->blocksize) != 0) {
- return (EINVAL);
+ if (cse->txform) {
+ if (cop->len == 0 || (cop->len % cse->txform->blocksize) != 0)
+ return (EINVAL);
}
bzero(&cse->uio, sizeof(cse->uio));