From dedaae7f2118a8d968db789b395c856dd37b0440 Mon Sep 17 00:00:00 2001 From: yang1946 Date: Tue, 5 Mar 2024 11:26:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E7=AD=BE=E5=90=8D=E4=BB=93?= =?UTF-8?q?=E5=91=8A=E8=AD=A6=E6=B8=85=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yang1946 --- test/unittest/multi_thread_local_sign_test.cpp | 6 +++--- test/unittest/sign_and_enforce_test.cpp | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/test/unittest/multi_thread_local_sign_test.cpp b/test/unittest/multi_thread_local_sign_test.cpp index d00be68..506f5c6 100644 --- a/test/unittest/multi_thread_local_sign_test.cpp +++ b/test/unittest/multi_thread_local_sign_test.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Huawei Device Co., Ltd. + * Copyright (c) 2023-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -37,7 +37,7 @@ static constexpr uint32_t MULTI_THREAD_NUM = 10; static constexpr int64_t BUFFER_SIZE = 1024; static const std::string AN_BASE_PATH = "/data/local/ark-cache/tmp/multi_thread/"; static const std::string ORIGIN_AN_FILE = AN_BASE_PATH + "demo.an"; -static const char *g_validCaller = "installs"; +static const char *VALID_CALLER = "installs"; uint64_t GetFileSize(int32_t fd) { @@ -81,7 +81,7 @@ static bool DupFile(const std::string &path) void LocalCodeSignAndEnforce() { ByteBuffer sig; - uint64_t selfTokenId = NativeTokenSet(g_validCaller); + uint64_t selfTokenId = NativeTokenSet(VALID_CALLER); int ret = LocalCodeSignKit::SignLocalCode(ORIGIN_AN_FILE, sig); std::thread::id thisId = std::this_thread::get_id(); std::ostringstream oss; diff --git a/test/unittest/sign_and_enforce_test.cpp b/test/unittest/sign_and_enforce_test.cpp index aa28d78..726fdfc 100644 --- a/test/unittest/sign_and_enforce_test.cpp +++ b/test/unittest/sign_and_enforce_test.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Huawei Device Co., Ltd. + * Copyright (c) 2023-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -37,7 +37,7 @@ static const std::string AN_BASE_PATH = "/data/local/ark-cache/tmp/"; static const std::string DEMO_AN_PATH = AN_BASE_PATH + "demo.an"; static const std::string DEMO_TAMPER_AN_PATH = AN_BASE_PATH + "fake_demo.an"; -static const char *g_validCaller = "installs"; +static const char *VALID_CALLER = "installs"; static const std::string FAKE_SERIAL_NUMBER = "0xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"; static const std::string FAKE_CONTENT = "FAKE"; @@ -135,7 +135,7 @@ static bool ModifyPkcs7SignerwithTargetFunc(ByteBuffer &src, ByteBuffer &dst, static void InvokeLocalCodeSign(const std::string &filePath, ByteBuffer &sig) { - uint64_t selfTokenId = NativeTokenSet(g_validCaller); + uint64_t selfTokenId = NativeTokenSet(VALID_CALLER); int ret = LocalCodeSignKit::SignLocalCode(filePath, sig); NativeTokenReset(selfTokenId); EXPECT_EQ(ret, CS_SUCCESS); -- Gitee