Module Name: src Committed By: christos Date: Thu Jun 13 02:07:31 UTC 2019
Modified Files: src/sys/opencrypto: crypto.c Log Message: Try to load swcrypto if we we did not find any software drivers. To generate a diff of this commit: cvs rdiff -u -r1.106 -r1.107 src/sys/opencrypto/crypto.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/opencrypto/crypto.c diff -u src/sys/opencrypto/crypto.c:1.106 src/sys/opencrypto/crypto.c:1.107 --- src/sys/opencrypto/crypto.c:1.106 Tue Jun 5 21:49:09 2018 +++ src/sys/opencrypto/crypto.c Wed Jun 12 22:07:31 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: crypto.c,v 1.106 2018/06/06 01:49:09 maya Exp $ */ +/* $NetBSD: crypto.c,v 1.107 2019/06/13 02:07:31 christos Exp $ */ /* $FreeBSD: src/sys/opencrypto/crypto.c,v 1.4.2.5 2003/02/26 00:14:05 sam Exp $ */ /* $OpenBSD: crypto.c,v 1.41 2002/07/17 23:52:38 art Exp $ */ @@ -53,7 +53,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: crypto.c,v 1.106 2018/06/06 01:49:09 maya Exp $"); +__KERNEL_RCSID(0, "$NetBSD: crypto.c,v 1.107 2019/06/13 02:07:31 christos Exp $"); #include <sys/param.h> #include <sys/reboot.h> @@ -746,6 +746,7 @@ crypto_select_driver_lock(struct cryptoi u_int32_t hid; int accept; struct cryptocap *cap, *best; + int error = 0; best = NULL; /* @@ -810,6 +811,14 @@ again: goto again; } + if (best == NULL && hard == 0 && error == 0) { + error = module_autoload("swcrypto", MODULE_CLASS_DRIVER); + if (error == 0) { + error = EINVAL; + goto again; + } + } + return best; }