summaryrefslogtreecommitdiffstats
path: root/crypto/engine/eng_devcrypto.c
diff options
context:
space:
mode:
authorJung-uk Kim <jkim@FreeBSD.org>2018-12-13 18:18:16 -0500
committerDr. Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com>2018-12-23 00:07:13 +0100
commitc79a022da973140c141eeebff9170ca5702be0f9 (patch)
tree60f67c6e856b5cb168a938ffd68a11add9928d15 /crypto/engine/eng_devcrypto.c
parentda84249be6492ccfc5ecad32ac367fd06e9bdbef (diff)
Do not complain when /dev/crypto does not exist.
FreeBSD does not enable cryptodev(4) by default. OpenBSD disabled support for /dev/crypto by default from 4.9 and removed it from 5.7. Now the engine is properly enabled by default on BSD platforms (see #7885), it continuously complains: Could not open /dev/crypto: No such file or directory Hide the nagging error message behind ENGINE_DEVCRYPTO_DEBUG. CLA: trivial Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Paul Dale <paul.dale@oracle.com> Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com> (Merged from https://github.com/openssl/openssl/pull/7896)
Diffstat (limited to 'crypto/engine/eng_devcrypto.c')
-rw-r--r--crypto/engine/eng_devcrypto.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/crypto/engine/eng_devcrypto.c b/crypto/engine/eng_devcrypto.c
index bfdb8fc68a..ec6337de11 100644
--- a/crypto/engine/eng_devcrypto.c
+++ b/crypto/engine/eng_devcrypto.c
@@ -25,6 +25,8 @@
#include "internal/engine.h"
+/* #define ENGINE_DEVCRYPTO_DEBUG */
+
#ifdef CRYPTO_ALGORITHM_MIN
# define CHECK_BSD_STYLE_MACROS
#endif
@@ -1156,7 +1158,10 @@ void engine_load_devcrypto_int()
ENGINE *e = NULL;
if ((cfd = open("/dev/crypto", O_RDWR, 0)) < 0) {
- fprintf(stderr, "Could not open /dev/crypto: %s\n", strerror(errno));
+#ifndef ENGINE_DEVCRYPTO_DEBUG
+ if (errno != ENOENT)
+#endif
+ fprintf(stderr, "Could not open /dev/crypto: %s\n", strerror(errno));
return;
}