1 /*
2  * Copyright (c) 2020 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 #ifndef __SEC_CLONE_SERVER_H__
17 #define __SEC_CLONE_SERVER_H__
18 
19 #include "hichain.h"
20 
21 enum SEC_CLONE_MESSAGE_TYPE {
22     SEC_CLONE_START_MSG = 1,
23     SEC_CLONE_END_MSG,
24 };
25 
26 #if (defined(_SUPPORT_SEC_CLONE_) || defined(_SUPPORT_SEC_CLONE_SERVER_))
27 
28 #include "base.h"
29 #include "key_agreement_server.h"
30 
31 struct sec_clone_server {
32     struct key_agreement_server server_info;
33     bool need_clean_temp_key;
34     hc_handle hichain_handle;
35     struct uint8_buff start_request_data;
36     struct uint8_buff client_sec_data;
37     struct hc_key_alias cert_key_alias;
38 };
39 
40 #else
41 
42 struct sec_clone_server {
43     char rsv;
44 };
45 
46 #endif
47 
48 void destroy_sec_clone_server(struct sec_clone_server *handle);
49 
50 #endif
51