From: Tomasz Swierczek Date: Mon, 17 Jan 2022 11:06:21 +0000 (+0100) Subject: Fix build break with -Wshadow compiler flag X-Git-Tag: accepted/tizen/7.0/unified/20221110.063345^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fheads%2Faccepted%2Ftizen_7.0_unified;p=platform%2Fcore%2Fsecurity%2Fyaca.git Fix build break with -Wshadow compiler flag In some env. a certain set of compiler flags is used and few "int ret" variables seem to cause an issue, overshadowing previous declarations. Change-Id: I724fdc1a3bb381a33700145872d180c7ba4c8d18 --- diff --git a/tests/mock_test_key.cpp b/tests/mock_test_key.cpp index 2c94c4d..73432ac 100644 --- a/tests/mock_test_key.cpp +++ b/tests/mock_test_key.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020 Samsung Electronics Co., Ltd All Rights Reserved + * Copyright (c) 2020-2022 Samsung Electronics Co., Ltd All Rights Reserved * * Contact: Lukasz Pawelczyk * @@ -422,14 +422,14 @@ BOOST_FIXTURE_TEST_CASE(T1207__mock__negative__key_derive_kdf, InitFixture) for (const auto &ka: kargs) { auto test_code = [&ka, &secret]() { - int ret; + int ret_derive; char *key_material = NULL;; - ret = yaca_key_derive_kdf(ka.kdf, ka.digest, secret, SECRET_LEN, - NULL, 0, MATERIAL_LEN, &key_material); + ret_derive = yaca_key_derive_kdf(ka.kdf, ka.digest, secret, SECRET_LEN, + NULL, 0, MATERIAL_LEN, &key_material); yaca_free(key_material); - return ret; + return ret_derive; }; call_mock_test(test_code); @@ -461,14 +461,14 @@ BOOST_FIXTURE_TEST_CASE(T1208__mock__negative__key_derive_pbkdf2, InitFixture) for (const auto &pa: pargs) { auto test_code = [&pa, &salt]() { - int ret; + int ret_derive; yaca_key_h key = YACA_KEY_NULL; - ret = yaca_key_derive_pbkdf2(PASSWORD, salt, SALT_LEN, pa.iter, - pa.digest, pa.bit_len, &key); + ret_derive = yaca_key_derive_pbkdf2(PASSWORD, salt, SALT_LEN, pa.iter, + pa.digest, pa.bit_len, &key); yaca_key_destroy(key); - return ret; + return ret_derive; }; call_mock_test(test_code);