1 /* 2 * Copyright (C) 2021-2023 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #include "hc_dev_info.h" 17 #include "securec.h" 18 #include "parameter.h" 19 #include "hal_error.h" 20 #include "hc_log.h" 21 22 #ifdef __cplusplus 23 extern "C" { 24 #endif 25 HcGetUdid(uint8_t * udid,int32_t udidLen)26int32_t HcGetUdid(uint8_t *udid, int32_t udidLen) 27 { 28 if (udid == NULL || udidLen < INPUT_UDID_LEN || udidLen > MAX_INPUT_UDID_LEN) { 29 return HAL_ERR_INVALID_PARAM; 30 } 31 int32_t res = GetDevUdid((char *)udid, udidLen); 32 if (res != 0) { 33 LOGE("[UDID]: GetDevUdid fail. [Res]: %" LOG_PUB "d", res); 34 return HAL_FAILED; 35 } 36 return HAL_SUCCESS; 37 } 38 GetStoragePath(void)39const char *GetStoragePath(void) 40 { 41 return AUTH_STORAGE_PATH "/hcgroup.dat"; 42 } 43 GetStorageDirPathCe(void)44const char *GetStorageDirPathCe(void) 45 { 46 return NULL; 47 } 48 GetStorageDirPath(void)49const char *GetStorageDirPath(void) 50 { 51 return AUTH_STORAGE_PATH; 52 } 53 GetAccountStoragePath(void)54const char *GetAccountStoragePath(void) 55 { 56 return AUTH_STORAGE_PATH "/account"; 57 } 58 59 #ifdef __cplusplus 60 } 61 #endif 62