From 2231ae96d5bdadef0bb8d07b37f27ea61e630c92 Mon Sep 17 00:00:00 2001 From: Nickolay Olshevsky Date: Mon, 15 Jan 2024 17:07:51 +0200 Subject: [PATCH] Fix tests for case with unavailable blowfish cipher. --- src/tests/ffi-enc.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/tests/ffi-enc.cpp b/src/tests/ffi-enc.cpp index 775353c575..48dc132bf0 100644 --- a/src/tests/ffi-enc.cpp +++ b/src/tests/ffi-enc.cpp @@ -178,15 +178,16 @@ TEST_F(rnp_tests, test_ffi_encrypt_pass) assert_rnp_failure(rnp_op_encrypt_add_password(op, "pass2", "SM3", 12345, "TWOFISH")); assert_rnp_failure( rnp_op_encrypt_add_password(op, "pass2", "SHA256", 12345, "TWOFISH")); - assert_rnp_success( - rnp_op_encrypt_add_password(op, "pass2", "SHA256", 12345, "BLOWFISH")); + const char *alg = blowfish_enabled() ? "BLOWFISH" : "AES256"; + assert_rnp_success(rnp_op_encrypt_add_password(op, "pass2", "SHA256", 12345, alg)); } else if (!sm2_enabled() && twofish_enabled()) { assert_rnp_failure(rnp_op_encrypt_add_password(op, "pass2", "SM3", 12345, "TWOFISH")); assert_rnp_success( rnp_op_encrypt_add_password(op, "pass2", "SHA256", 12345, "TWOFISH")); } else if (sm2_enabled() && !twofish_enabled()) { assert_rnp_failure(rnp_op_encrypt_add_password(op, "pass2", "SM3", 12345, "TWOFISH")); - assert_rnp_success(rnp_op_encrypt_add_password(op, "pass2", "SM3", 12345, "BLOWFISH")); + const char *alg = blowfish_enabled() ? "BLOWFISH" : "AES256"; + assert_rnp_success(rnp_op_encrypt_add_password(op, "pass2", "SM3", 12345, alg)); } else { assert_rnp_success(rnp_op_encrypt_add_password(op, "pass2", "SM3", 12345, "TWOFISH")); }