Thu Dec 5 17:52:06 2019 UTC ()
PR/54740: Izumi Tsutsui: Disable cryptoengine unavailable message when
device is not configured (ENXIO).


(christos)
diff -r1.4 -r1.5 src/crypto/external/bsd/openssl/dist/crypto/engine/eng_devcrypto.c

cvs diff -r1.4 -r1.5 src/crypto/external/bsd/openssl/dist/crypto/engine/Attic/eng_devcrypto.c (expand / switch to unified diff)

--- src/crypto/external/bsd/openssl/dist/crypto/engine/Attic/eng_devcrypto.c 2019/03/12 16:58:13 1.4
+++ src/crypto/external/bsd/openssl/dist/crypto/engine/Attic/eng_devcrypto.c 2019/12/05 17:52:06 1.5
@@ -751,27 +751,27 @@ static int devcrypto_unload(ENGINE *e) @@ -751,27 +751,27 @@ static int devcrypto_unload(ENGINE *e)
751 751
752 return 1; 752 return 1;
753} 753}
754/* 754/*
755 * This engine is always built into libcrypto, so it doesn't offer any 755 * This engine is always built into libcrypto, so it doesn't offer any
756 * ability to be dynamically loadable. 756 * ability to be dynamically loadable.
757 */ 757 */
758void engine_load_devcrypto_int() 758void engine_load_devcrypto_int()
759{ 759{
760 ENGINE *e = NULL; 760 ENGINE *e = NULL;
761 761
762 if ((cfd = open("/dev/crypto", O_RDWR, 0)) < 0) { 762 if ((cfd = open("/dev/crypto", O_RDWR, 0)) < 0) {
763#ifndef ENGINE_DEVCRYPTO_DEBUG 763#ifndef ENGINE_DEVCRYPTO_DEBUG
764 if (errno != ENOENT) 764 if (errno != ENOENT && errno != ENXIO)
765#endif 765#endif
766 fprintf(stderr, "Could not open /dev/crypto: %s\n", strerror(errno)); 766 fprintf(stderr, "Could not open /dev/crypto: %s\n", strerror(errno));
767 return; 767 return;
768 } 768 }
769 769
770 if ((e = ENGINE_new()) == NULL 770 if ((e = ENGINE_new()) == NULL
771 || !ENGINE_set_destroy_function(e, devcrypto_unload)) { 771 || !ENGINE_set_destroy_function(e, devcrypto_unload)) {
772 ENGINE_free(e); 772 ENGINE_free(e);
773 /* 773 /*
774 * We know that devcrypto_unload() won't be called when one of the 774 * We know that devcrypto_unload() won't be called when one of the
775 * above two calls have failed, so we close cfd explicitly here to 775 * above two calls have failed, so we close cfd explicitly here to
776 * avoid leaking resources. 776 * avoid leaking resources.
777 */ 777 */