• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2021-2022 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)26 int32_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 ret = GetDevUdid((char *)udid, udidLen);
32     if (ret != 0) {
33         LOGE("Failed to get dev udid, ret = %d", ret);
34         return HAL_FAILED;
35     }
36     return HAL_SUCCESS;
37 }
38 
GetStoragePath(void)39 const char *GetStoragePath(void)
40 {
41     return AUTH_STORAGE_PATH "/hcgroup.dat";
42 }
43 
GetStorageDirPath(void)44 const char *GetStorageDirPath(void)
45 {
46     return AUTH_STORAGE_PATH;
47 }
48 
49 #ifdef __cplusplus
50 }
51 #endif
52