1 /*
2 * Copyright (c) 2025-2025 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 <stddef.h>
17 #include <stdint.h>
18 #include <stdbool.h>
19 #include "cf_blob.h"
20 #include "cf_result.h"
21 #include "hm_attestation_cert_ext_type.h"
22 #include "hm_attestation_cert_verify.h"
23 #include "attestation_cert_verify.h"
24
HcfAttestCreateVerifyParam(HcfAttestCertVerifyParam ** param)25 CfResult HcfAttestCreateVerifyParam(HcfAttestCertVerifyParam **param)
26 {
27 return AttestCreateVerifyParam(param);
28 }
29
HcfAttestSetVerifyParamCheckTime(HcfAttestCertVerifyParam * param,bool checkTime)30 CfResult HcfAttestSetVerifyParamCheckTime(HcfAttestCertVerifyParam *param, bool checkTime)
31 {
32 return AttestSetVerifyParamCheckTime(param, checkTime);
33 }
34
HcfAttestSetVerifyParamRootCa(HcfAttestCertVerifyParam * param,const CfEncodingBlob * rootCa)35 CfResult HcfAttestSetVerifyParamRootCa(HcfAttestCertVerifyParam *param, const CfEncodingBlob *rootCa)
36 {
37 return AttestSetVerifyParamRootCa(param, rootCa);
38 }
39
HcfAttestSetVerifyParamSnInfos(HcfAttestCertVerifyParam * param,const HmAttestationSnInfo * snInfo)40 CfResult HcfAttestSetVerifyParamSnInfos(HcfAttestCertVerifyParam *param, const HmAttestationSnInfo *snInfo)
41 {
42 return AttestSetVerifyParamSnInfos(param, snInfo);
43 }
44
HcfAttestFreeVerifyParam(HcfAttestCertVerifyParam * param)45 void HcfAttestFreeVerifyParam(HcfAttestCertVerifyParam *param)
46 {
47 AttestFreeVerifyParam(param);
48 }
49
HcfAttestCertVerify(const CfEncodingBlob * encodingBlob,const HcfAttestCertVerifyParam * param,HmAttestationInfo ** info)50 CfResult HcfAttestCertVerify(const CfEncodingBlob *encodingBlob, const HcfAttestCertVerifyParam *param,
51 HmAttestationInfo **info)
52 {
53 return AttestCertVerify(encodingBlob, param, info);
54 }
55
HcfAttestCertParseExtension(HmAttestationInfo * info)56 CfResult HcfAttestCertParseExtension(HmAttestationInfo *info)
57 {
58 return AttestCertParseExtension(info);
59 }
60
HcfAttestCheckBoundedWithUdId(HmAttestationInfo * info)61 CfResult HcfAttestCheckBoundedWithUdId(HmAttestationInfo *info)
62 {
63 return AttestCheckBoundedWithUdId(info);
64 }
65
HcfAttestCheckBoundedWithSocid(HmAttestationInfo * info)66 CfResult HcfAttestCheckBoundedWithSocid(HmAttestationInfo *info)
67 {
68 return AttestCheckBoundedWithSocid(info);
69 }
70
HcfAttestGetCertExtension(HmAttestationInfo * info,HmAttestationCertExtType type,HmAttestationCertExt * ext)71 CfResult HcfAttestGetCertExtension(HmAttestationInfo *info, HmAttestationCertExtType type, HmAttestationCertExt *ext)
72 {
73 return AttestGetCertExtension(info, type, ext);
74 }
75
HcfAttestInfoFree(HmAttestationInfo * info)76 void HcfAttestInfoFree(HmAttestationInfo *info)
77 {
78 AttestInfoFree(info);
79 }
80