From: Taylor R Campbell Date: Wed, 29 Mar 2023 13:21:02 +0000 (+0000) Subject: /dev/crypto: Suppress warning when open /dev/crypto fails with ENXIO. X-Git-Tag: openssl-3.2.0-alpha1~1042 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1636b355ade558d01f5a826494264ca31d6aeeb7;p=thirdparty%2Fopenssl.git /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 Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/20636) --- diff --git a/engines/e_devcrypto.c b/engines/e_devcrypto.c index 49ebe00b63c..92c8f0e3568 100644 --- a/engines/e_devcrypto.c +++ b/engines/e_devcrypto.c @@ -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;