summaryrefslogtreecommitdiff
path: root/sys/crypto
diff options
context:
space:
mode:
authorThordur I. Bjornsson <thib@cvs.openbsd.org>2010-07-08 09:46:51 +0000
committerThordur I. Bjornsson <thib@cvs.openbsd.org>2010-07-08 09:46:51 +0000
commit4cde107f58152405509ef6d697ef46e93958fa59 (patch)
tree353f19026f485ece74d4f2dd32dbf13e82f6178c /sys/crypto
parented3123ada7f44428471003d6c1429caace9d2453 (diff)
Revert part of previous.
The splvm protection is needed after all, as we are walking the list of registered crypto drivers and doing that unprotected is unwise. Pointed out by kettenis@
Diffstat (limited to 'sys/crypto')
-rw-r--r--sys/crypto/crypto.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/crypto/crypto.c b/sys/crypto/crypto.c
index 48dbee25c84..e34936c5bc4 100644
--- a/sys/crypto/crypto.c
+++ b/sys/crypto/crypto.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: crypto.c,v 1.55 2010/07/08 08:12:48 thib Exp $ */
+/* $OpenBSD: crypto.c,v 1.56 2010/07/08 09:46:50 thib Exp $ */
/*
* The author of this code is Angelos D. Keromytis (angelos@cis.upenn.edu)
*
@@ -52,6 +52,8 @@ crypto_newsession(u_int64_t *sid, struct cryptoini *cri, int hard)
if (crypto_drivers == NULL)
return EINVAL;
+ s = splvm();
+
/*
* The algorithm we use here is pretty stupid; just use the
* first driver that supports all the algorithms we need. Do
@@ -146,10 +148,10 @@ crypto_newsession(u_int64_t *sid, struct cryptoini *cri, int hard)
* XXX layer right about here.
*/
- if (hid == -1)
+ if (hid == -1) {
+ splx(s);
return EINVAL;
-
- s = splvm();
+ }
/* Call the driver initialization routine. */
lid = hid; /* Pass the driver ID. */