diff options
author | pjd <pjd@FreeBSD.org> | 2006-05-17 18:01:51 +0000 |
---|---|---|
committer | pjd <pjd@FreeBSD.org> | 2006-05-17 18:01:51 +0000 |
commit | f7d288e1578ea2da827162e1e2dbf7f964148b81 (patch) | |
tree | f7df5de341ea68cbbf33abecb6167af1cdf137e3 | |
parent | 5a9dad02c22c8fdf067e002fab23546cf58fafbf (diff) | |
download | FreeBSD-src-f7d288e1578ea2da827162e1e2dbf7f964148b81.zip FreeBSD-src-f7d288e1578ea2da827162e1e2dbf7f964148b81.tar.gz |
If kern.cryptodevallowsoft is TRUE allow also for symmetric software crypto
in kernel. Useful for testing.
Reviewed by: sam
-rw-r--r-- | sys/opencrypto/cryptodev.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/sys/opencrypto/cryptodev.c b/sys/opencrypto/cryptodev.c index fa1b0d8..9c3490f 100644 --- a/sys/opencrypto/cryptodev.c +++ b/sys/opencrypto/cryptodev.c @@ -265,8 +265,14 @@ cryptof_ioctl( } error = crypto_newsession(&sid, (txform ? &crie : &cria), 1); - if (error) - goto bail; + if (error) { + if (crypto_devallowsoft) { + error = crypto_newsession(&sid, + (txform ? &crie : &cria), 0); + } + if (error) + goto bail; + } cse = csecreate(fcr, sid, crie.cri_key, crie.cri_klen, cria.cri_key, cria.cri_klen, sop->cipher, sop->mac, txform, |