15ba71b47Sopenharmony_ci/*
25ba71b47Sopenharmony_ci * Copyright (c) 2024 Huawei Device Co., Ltd.
35ba71b47Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
45ba71b47Sopenharmony_ci * you may not use this file except in compliance with the License.
55ba71b47Sopenharmony_ci * You may obtain a copy of the License at
65ba71b47Sopenharmony_ci *
75ba71b47Sopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
85ba71b47Sopenharmony_ci *
95ba71b47Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software
105ba71b47Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
115ba71b47Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
125ba71b47Sopenharmony_ci * See the License for the specific language governing permissions and
135ba71b47Sopenharmony_ci * limitations under the License.
145ba71b47Sopenharmony_ci */
155ba71b47Sopenharmony_ci
165ba71b47Sopenharmony_ci#include "getsaextensioninfo_fuzzer.h"
175ba71b47Sopenharmony_ci
185ba71b47Sopenharmony_ci#include "fuzztest_utils.h"
195ba71b47Sopenharmony_ci#include "samgr_ipc_interface_code.h"
205ba71b47Sopenharmony_cinamespace OHOS {
215ba71b47Sopenharmony_ciconstexpr size_t THRESHOLD = 4;
225ba71b47Sopenharmony_ciconstexpr uint32_t CODE = static_cast<uint32_t>(SamgrInterfaceCode::GET_SA_EXTENSION_INFO_TRANSCATION);
235ba71b47Sopenharmony_ci}
245ba71b47Sopenharmony_ci/* Fuzzer entry point */
255ba71b47Sopenharmony_ciextern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
265ba71b47Sopenharmony_ci{
275ba71b47Sopenharmony_ci    if (size < OHOS::THRESHOLD) {
285ba71b47Sopenharmony_ci        return 0;
295ba71b47Sopenharmony_ci    }
305ba71b47Sopenharmony_ci    OHOS::Samgr::FuzzTestUtils::FuzzTestRemoteRequest(data, size, OHOS::CODE);
315ba71b47Sopenharmony_ci    return 0;
325ba71b47Sopenharmony_ci}