summaryrefslogtreecommitdiffstats
path: root/sys/crypto/cryptodev.c
diff options
context:
space:
mode:
authorjason <jason@openbsd.org>2003-06-10 18:34:51 +0000
committerjason <jason@openbsd.org>2003-06-10 18:34:51 +0000
commit9b1dcadeb080ab60dc8d1fb7e6c64b0f2e154491 (patch)
tree84c93c4056ebd94c84a4eeb4210e66425a1254fe /sys/crypto/cryptodev.c
parentadd missing copyright notice (diff)
downloadwireguard-openbsd-9b1dcadeb080ab60dc8d1fb7e6c64b0f2e154491.tar.xz
wireguard-openbsd-9b1dcadeb080ab60dc8d1fb7e6c64b0f2e154491.zip
don't allow /dev/crypto to be opened ifndef CRYPTO (the thread hasn't been
started, so all operations will hang later on anyway).
Diffstat (limited to 'sys/crypto/cryptodev.c')
-rw-r--r--sys/crypto/cryptodev.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/crypto/cryptodev.c b/sys/crypto/cryptodev.c
index 94442dbf969..001edcf5fe8 100644
--- a/sys/crypto/cryptodev.c
+++ b/sys/crypto/cryptodev.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cryptodev.c,v 1.58 2003/06/03 15:51:28 deraadt Exp $ */
+/* $OpenBSD: cryptodev.c,v 1.59 2003/06/10 18:34:51 jason Exp $ */
/*
* Copyright (c) 2001 Theo de Raadt
@@ -630,7 +630,11 @@ cryptoopen(dev_t dev, int flag, int mode, struct proc *p)
{
if (usercrypto == 0)
return (ENXIO);
+#ifdef CRYPTO
return (0);
+#else
+ return (ENXIO);
+#endif
}
int