[LTP] [PATCH 1/1] tst_af_alg: Another fix for disabled weak cyphers

Petr Vorel pvorel@suse.cz
Thu Dec 16 13:54:56 CET 2021


e.g. md5 and sm3 on enabled FIPS (fips=1 on cmdline) on SLES 15-SP4.
Similar fix to 4fa302ef9d. It fixes:

tst_af_alg.c:84: TBROK: unexpected error binding AF_ALG socket to hash algorithm 'md5': ELIBBAD (80)
become
af_alg01.c:26: TCONF: kernel doesn't have hash algorithm 'md5'
af_alg01.c:26: TCONF: kernel doesn't have hash algorithm 'md5-generic'
...
af_alg01.c:26: TCONF: kernel doesn't have hash algorithm 'sm3'
af_alg01.c:26: TCONF: kernel doesn't have hash algorithm 'sm3-generic'

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 lib/tst_af_alg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/tst_af_alg.c b/lib/tst_af_alg.c
index 05caa63016..e1cb480f77 100644
--- a/lib/tst_af_alg.c
+++ b/lib/tst_af_alg.c
@@ -77,7 +77,7 @@ bool tst_have_alg(const char *algtype, const char *algname)
 
 	ret = bind(algfd, (const struct sockaddr *)&addr, sizeof(addr));
 	if (ret != 0) {
-		if (errno != ENOENT) {
+		if (errno != ENOENT && errno != ELIBBAD) {
 			tst_brk(TBROK | TERRNO,
 				"unexpected error binding AF_ALG socket to %s algorithm '%s'",
 				algtype, algname);
-- 
2.34.1



More information about the ltp mailing list