/dev/crypto: Suppress warning when open /dev/crypto fails with ENXIO.

On NetBSD the device node is essentially always present, but these
days it's mostly not useful except for testing the kernel crypto
stack since the cost of CPU crypto has gone down much faster than the
cost of I/O to external crypto engines.  So on most systems it is
disabled in a way that makes open fail with ENXIO.  NetBSD has had
this warning for ENXIO patched away for years.

CLA: trivial

Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/20636)
This commit is contained in:
Taylor R Campbell 2023-03-29 13:21:02 +00:00 committed by Tomas Mraz
parent 8189fe242b
commit 1636b355ad

View File

@ -1228,7 +1228,7 @@ static int open_devcrypto(void)
if ((fd = open("/dev/crypto", O_RDWR, 0)) < 0) {
#ifndef ENGINE_DEVCRYPTO_DEBUG
if (errno != ENOENT)
if (errno != ENOENT && errno != ENXIO)
#endif
fprintf(stderr, "Could not open /dev/crypto: %s\n", strerror(errno));
return 0;