1 /*
2  * Copyright (c) 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 /**
17  * @addtogroup Privacy
18  * @{
19  *
20  * @brief Provides sensitive permissions access management.
21  *
22  * @since 8.0
23  * @version 8.0
24  */
25 
26 /**
27  * @file sec_comp_enhance_data.h
28  *
29  * @brief Declares security component enhance deposit data struct.
30  *
31  * @since 10.0
32  * @version 10.0
33  */
34 
35 #ifndef INTERFACE_INNER_KITS_PRIVACY_SEC_COMP_ENHANCE_DATA_H
36 #define INTERFACE_INNER_KITS_PRIVACY_SEC_COMP_ENHANCE_DATA_H
37 
38 #include "access_token.h"
39 #include "iremote_object.h"
40 
41 namespace OHOS {
42 namespace Security {
43 namespace AccessToken {
44 /**
45  * @brief Declares security component enhance data struct only for security component service
46  */
47 
48 static constexpr int32_t AES_KEY_STORAGE_LEN = 64;
49 struct SecCompEnhanceData {
50     /**
51      * callback remote object for checking security component valid.
52      */
53     sptr<IRemoteObject> callback;
54     /**
55      * pid for which used security component.
56      */
57     int32_t pid;
58     /**
59      * token id for which used security component.
60      */
61     AccessTokenID token;
62     /**
63      * challenge for register.
64      */
65     uint64_t challenge;
66     /**
67      * sessionId for register.
68      */
69     uint32_t sessionId;
70     /**
71      * sequence number of session.
72      */
73     uint32_t seqNum;
74     /**
75      * key to encrypt ipc message.
76      */
77     uint8_t key[AES_KEY_STORAGE_LEN];
78 };
79 
80 } // namespace AccessToken
81 } // namespace Security
82 } // namespace OHOS
83 #endif // INTERFACE_INNER_KITS_PRIVACY_SEC_COMP_ENHANCE_DATA_H
84 
85