1 /* SPDX-License-Identifier: BSD-2-Clause */
2 /*
3  * Copyright (C) Foundries Ltd. 2020 - All Rights Reserved
4  * Author: Jorge Ramirez <jorge@foundries.io>
5  */
6 
7 #ifndef SE050_SSS_APIS_H_
8 #define SE050_SSS_APIS_H_
9 
10 #include <fsl_sss_se05x_types.h>
11 #include <nxScp03_Types.h>
12 
13 extern sss_policy_t se050_asym_policy;
14 struct se050_scp_key;
15 
16 struct sss_se05x_ctx {
17 	SE_Connect_Ctx_t open_ctx;
18 	sss_se05x_session_t session;
19 	sss_se05x_key_store_t ks;
20 
21 	struct se050_auth_ctx {
22 		NXSCP03_StaticCtx_t static_ctx;
23 		NXSCP03_DynCtx_t dynamic_ctx;
24 	} se05x_auth;
25 
26 	sss_user_impl_session_t host_session;
27 	sss_key_store_t host_ks;
28 
29 	struct se05x_se_info {
30 		uint8_t applet[3];
31 		uint8_t oefid[2];
32 	} se_info;
33 };
34 
35 sss_status_t se050_key_store_and_object_init(struct sss_se05x_ctx *ctx);
36 sss_status_t se050_enable_scp03(sss_se05x_session_t *session);
37 sss_status_t se050_rotate_scp03_keys(struct sss_se05x_ctx *ctx);
38 sss_status_t se050_session_open(struct sss_se05x_ctx *ctx,
39 				struct se050_scp_key *key);
40 #endif /* SE050_SSS_APIS_H_ */
41