AM261x MCU+ SDK  10.02.00
hsmclient.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2022-24 Texas Instruments Incorporated
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  *
8  * Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  *
11  * Redistributions in binary form must reproduce the above copyright
12  * notice, this list of conditions and the following disclaimer in the
13  * documentation and/or other materials provided with the
14  * distribution.
15  *
16  * Neither the name of Texas Instruments Incorporated nor the names of
17  * its contributors may be used to endorse or promote products derived
18  * from this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  */
32 
33 #ifndef HSM_CLIENT_H_
34 #define HSM_CLIENT_H_
35 
36 #ifdef __cplusplus
37 extern "C"
38 {
39 #endif
40 
41 /* Header file for HSM client driver */
42 #include <stdint.h>
46 #include <kernel/dpl/SemaphoreP.h>
47 
56 #define LABEL_AND_CONTEXT_LEN_MAX 48U
57 
62 #define HSMRT_LOAD_NOT_REQUESTED (0U)
63 
67 #define HSMRT_LOAD_REQUESTED (1U)
68 
72 #define HSMRT_LOAD_FAILED (2U)
73 
77 #define HSMRT_LOAD_SUCCEEDED (3U)
78 
84  typedef union HsmVer_t_
85  {
86  uint64_t HsmrtVer ;
87  struct
88  {
89  uint8_t PatchVer;
90  uint8_t MinorVer;
91  uint8_t MajorVer;
92  uint8_t ApiVer;
93  uint8_t SocType;
94  uint8_t BinType;
95  uint8_t HsmType;
96  uint8_t DevType;
99 #if defined(_TMS320C6X)
100  } __attribute__((packed)) HsmVer_t_;
101 #else
102 } __attribute__((packed)) HsmVer_t;
103 #endif
104 
110  typedef struct HsmClient_t_
111  {
114  HsmMsg_t ReqMsg;
115  HsmMsg_t RespMsg;
116  uint8_t RespFlag;
117  uint8_t ClientId;
119  } HsmClient_t;
120 
128  typedef struct NvmOtpRead_t_
129  {
130  uint32_t rowData;
131  uint16_t rowIdx;
132  uint8_t rsvd[2];
133  } NvmOtpRead_t;
134 
142  typedef struct NvmOtpRowWrite_t_
143  {
144  uint32_t rowData;
145  uint32_t rowBitMask;
146  uint16_t rowIdx;
147  uint8_t rsvd[2];
149 
155  typedef struct NvmOtpRowCount_t_
156  {
157  uint32_t rowCount;
158  uint8_t rowSize;
159  uint8_t rsvd[3];
161 
169  typedef struct NvmOtpRowProt_t_
170  {
171  uint16_t rowidx;
172  uint8_t readProt;
173  uint8_t writeProt;
174  } NvmOtpRowProt_t;
175 
181  typedef struct keywriter_cert_header_t_
182  {
183  uint8_t *certAddress; /*For holding cerificate address*/
184  uint32_t certSize; /*Cerificate size*/
185  uint32_t debugResponse; /*Debug response*/
186  uint32_t reserved; /*reserved for future use*/
188 
194  typedef struct FirewallRegionReq_t_
195  {
196  uint16_t firewallId;
197  uint16_t region;
199  uint32_t startAddress;
200  uint32_t endAddress;
202 
208  typedef struct FirewallReq_t_
209  {
210  uint16_t regionCount;
211  uint16_t crcArr;
214  } FirewallReq_t;
215 
222  typedef struct FirewallIntrReq_t_
223  {
224  uint16_t firewallId;
225  uint8_t interruptEnable;
228  uint8_t faultClear;
230 
240  typedef struct SWRev_t_
241  {
242  uint32_t revValue;
243  uint8_t revId;
244  uint8_t rsvd[3];
245  } SWRev_t;
246 
257  typedef struct DKEK_t_
258  {
259  uint8_t label_length;
260  uint8_t context_length;
261  uint8_t label_and_context[LABEL_AND_CONTEXT_LEN_MAX];
262  uint32_t dkek[8];
263  } DKEK_t;
264 
276  typedef struct RNGReq_t_
277  {
278  uint8_t *resultPtr;
279  uint32_t *resultLengthPtr;
280  uint8_t DRBGMode;
281  uint32_t *seedValue;
283  uint8_t reserved;
284  } RNGReq_t;
285 
291  typedef struct SecureBoot_Stream_t_
292  {
293  uint8_t *dataIn;
294  uint32_t dataLen;
295  uint8_t canBeEncrypted;
296  } __attribute__((packed)) SecureBoot_Stream_t;
297 
306  typedef struct FirmwareUpdateReq_t_
307  {
308  uint8_t *pStartAddress;
309  uint32_t dataLength;
310  uint32_t bankMode;
312 
313 
319 typedef struct OTFA_Region_t
320 {
321  uint8_t authMode ; /* mode of authentication - disable-0/GMAC-1/CMAC-2 ; */
322  uint8_t encMode ; /* mode of decryption - disable-0 or AES_CTR-1 */
323  uint16_t reservedArea ; /* reserved to align with 4kB structure */
324  uint32_t regionStAddr ; /* start address of the flash region for which the configuration should apply */
325  uint32_t regionSize ; /* size of the flash region in kB for which the configuration should apply */
326  uint8_t authKeyID ; /* Keyring ID of key to be used for authentication */
327  uint8_t encrKeyID ; /* Keyring ID of key to be used for encryption */
328  uint8_t encrKeyFetchMode ; /* specify which 16 bytes of DSMEK are to be used - 1 for fist 16/2 for last 16/ 3 for XOR of both */
329  uint8_t authAesKey [16] ; /* actual key value to be written to the register for authentication ; fetched from keyring */
330  uint8_t encrAesKey [16] ; /* actual key value to be written to the register for decryption ; fetched from keyring */
331  uint8_t regionIV[16] ; /* IV to be used for encryption */
332 }OTFA_Region_t ;
333 
338 typedef struct OTFA_readRegion_t
339 {
340  uint8_t regionNumber ; /* Index of the region - 0/1/2/3 */
341  uint8_t authMode ; /* mode of authentication - disable-0/GMAC-1/CMAC-2 ; */
342  uint8_t encMode ; /* mode of decryption - disable-0 or AES_CTR-1 */
343  uint8_t authKeyHash[64] ; /* hash of the authentication key stored in OTFA register */
344  uint8_t encKeyHash[64] ; /* hash of the encryption key stored in OTFA register */
345  uint32_t regionStAddr ; /* start address of the flash region for which the configuration should apply */
346  uint32_t regionSize ; /* size of the flash region in kB for which the configuration should apply */
347  uint16_t regionIV[16] ; /* IV to be used for encryption */
349 
355 typedef struct OTFA_Config_t
356 {
357  OTFA_Region_t OTFA_Reg[4] ; /* array of all registers' information of 4 OTFA Regions */
358  uint8_t numRegions ; /* number of OTFA regions to be configured */
359  uint8_t keySize ; /* options - 128/256 */
360  uint8_t macSize ; /* options - 4/8/12/16 */
361  uint8_t masterEnable ; /* specifies whether OTFA IP has to be enabled/disabled ; 0 or 1 */
362 }OTFA_Config_t ;
363 
375 
386  int32_t HsmClient_init(SIPC_Params *params);
387 
393  void HsmClient_deInit(void);
394 
401 void HsmClient_SecureBootQueueInit(uint32_t configured_hsm_client_msg_queue_size);
417 int32_t HsmClient_getVersion(HsmClient_t *HsmClient ,
418  HsmVer_t* verId,uint32_t timeToWaitInTick);
419 
435  int32_t HsmClient_getUID(HsmClient_t *HsmClient,
436  uint8_t *uid, uint32_t timeout);
437 
454  int32_t HsmClient_openDbgFirewall(HsmClient_t *HsmClient,
455  uint8_t *cert,
456  uint32_t cert_size,
457  uint32_t timeout);
458 
475  int32_t HsmClient_importKeyring(HsmClient_t *HsmClient,
476  uint8_t *cert,
477  uint32_t cert_size,
478  uint32_t timeout);
479 
492  int32_t HsmClient_readOTPRow(HsmClient_t *HsmClient,
493  NvmOtpRead_t *readRow);
494 
507  int32_t HsmClient_writeOTPRow(HsmClient_t *HsmClient,
508  NvmOtpRowWrite_t *writeRow);
509 
522  int32_t HsmClient_lockOTPRow(HsmClient_t *HsmClient,
523  NvmOtpRowProt_t *rowProt);
524 
537  int32_t HsmClient_getOTPRowCount(HsmClient_t *HsmClient,
538  NvmOtpRowCount_t *rowCount);
539 
552  int32_t HsmClient_getOTPRowProtection(HsmClient_t *HsmClient,
553  NvmOtpRowProt_t *rowProt);
554 
571  int32_t HsmClient_procAuthBoot(HsmClient_t *HsmClient,
572  uint8_t *cert,
573  uint32_t cert_size,
574  uint32_t timeout);
575 
590  int32_t HsmClient_procAuthBootStart(HsmClient_t *HsmClient,
591  SecureBoot_Stream_t *secureBootInfo);
592 
607  int32_t HsmClient_procAuthBootUpdate(HsmClient_t *HsmClient,
608  SecureBoot_Stream_t *secureBootInfo);
609 
624  int32_t HsmClient_procAuthBootFinish(HsmClient_t *HsmClient,
625  SecureBoot_Stream_t *secureBootInfo);
626 
642  int32_t HsmClient_setFirewall(HsmClient_t *HsmClient,
643  FirewallReq_t *FirewallReqObj,
644  uint32_t timeout);
660  int32_t HsmClient_FirewallIntr(HsmClient_t *HsmClient,
661  FirewallIntrReq_t *FirewallIntrReqObj,
662  uint32_t timeout);
663 
676  int32_t HsmClient_keyWriter(HsmClient_t *HsmClient,
677  KeyWriterCertHeader_t *certHeader,
678  uint32_t timeout);
679 
692  int32_t HsmClient_readSWRev(HsmClient_t *HsmClient,
693  SWRev_t *readSWRev);
694 
707  int32_t HsmClient_writeSWRev(HsmClient_t *HsmClient,
708  SWRev_t *writeSWRev);
709 
726  int32_t HsmClient_getDKEK(HsmClient_t *HsmClient,
727  DKEK_t *getDKEK,
728  uint32_t timeout);
740  int32_t HsmClient_register(HsmClient_t *HsmClient, uint8_t clientId);
741 
750  void HsmClient_unregister(HsmClient_t *HsmClient, uint8_t clientId);
751 
765  int32_t HsmClient_waitForBootNotify(HsmClient_t *HsmClient, uint32_t timeToWaitInTicks);
766 
777  int32_t Hsmclient_loadHSMRtFirmware(HsmClient_t *gHSMClient, const uint8_t *pHSMRt_firmware);
778 
788  int32_t Hsmclient_loadHSMRtFirmwareNonBlocking(const uint8_t *pHSMRt_firmware);
789 
801  int32_t HsmClient_getRandomNum(HsmClient_t *HsmClient,
802  RNGReq_t *getRandomNum);
803 
819  FirmwareUpdateReq_t *pFirmwareUpdateObject);
820 
835  FirmwareUpdateReq_t *pFirmwareUpdateObject);
836 
852  FirmwareUpdateReq_t *pFirmwareUpdateObject);
853 
870  uint8_t *cert,
871  uint32_t cert_size,
872  uint32_t timeout);
873 
888  int32_t HsmClient_UpdateKeyRevsion(HsmClient_t *HsmClient,
889  uint32_t timeout);
890 
902 int32_t HsmClient_configOTFARegions(HsmClient_t* HsmClient,
903  OTFA_Config_t* OTFA_ConfigInfo,
904  uint32_t timeout);
905 
917 int32_t HsmClient_readOTFARegions(HsmClient_t* HsmClient,
918  OTFA_readRegion_t* OTFA_readRegion,
919  uint32_t timeout);
920 
923 #ifdef __cplusplus
924 }
925 #endif
926 
927 #endif /* HSM_CLIENT_H_ */
OTFA_Region_t::encrAesKey
uint8_t encrAesKey[16]
Definition: hsmclient.h:330
OTFA_Config_t
This is the entire OTFA structure which holds all regions' information 4 regions in AM263Px and AM261...
Definition: hsmclient.h:356
SIPC_Params
Parameters used by SIPC_init.
Definition: sipc_notify.h:84
KeyWriterCertHeader_t::certSize
uint32_t certSize
Definition: hsmclient.h:184
HsmVer_t_
type for reading HSMRt version.
Definition: hsmclient.h:85
OTFA_readRegion_t::encMode
uint8_t encMode
Definition: hsmclient.h:342
HsmClient_checkAndWaitForBootNotification
int32_t HsmClient_checkAndWaitForBootNotification(void)
This API waits for HSMRT load if requested and then waits for boot notification. In case of failure i...
Definition: hsmclient.c:398
LABEL_AND_CONTEXT_LEN_MAX
#define LABEL_AND_CONTEXT_LEN_MAX
Definition: hsmclient.h:56
HsmClient_setFirewall
int32_t HsmClient_setFirewall(HsmClient_t *HsmClient, FirewallReq_t *FirewallReqObj, uint32_t timeout)
The service issued to HSM Server sets the firewall for the given firewall id and region.
Definition: hsmclient.c:1310
HsmClient_writeSWRev
int32_t HsmClient_writeSWRev(HsmClient_t *HsmClient, SWRev_t *writeSWRev)
The service issued to HSM Server writes the SWRevision value based on identifier as param.
Definition: hsmclient.c:1658
HsmVer_t_::PatchVer
uint8_t PatchVer
Definition: hsmclient.h:89
OTFA_Config_t::keySize
uint8_t keySize
Definition: hsmclient.h:359
SecureBoot_Stream_t_::dataIn
uint8_t * dataIn
Definition: hsmclient.h:293
HsmClient_firmwareUpdate_CodeProgram
int32_t HsmClient_firmwareUpdate_CodeProgram(HsmClient_t *HsmClient, FirmwareUpdateReq_t *pFirmwareUpdateObject)
service request issued to HSM server to program the incoming firmware to device dormant banks This se...
Definition: hsmclient.c:1884
NvmOtpRowCount_t::rowSize
uint8_t rowSize
Definition: hsmclient.h:158
FirewallRegionReq_t::region
uint16_t region
Definition: hsmclient.h:197
HsmClient_t::RespFlag
uint8_t RespFlag
Definition: hsmclient.h:116
SecureBoot_Stream_t_
This is the SecureBoot Stream type which holds the data for a specific bootloader to HSM call....
Definition: hsmclient.h:292
HsmClient_firmwareUpdate_CodeVerify
int32_t HsmClient_firmwareUpdate_CodeVerify(HsmClient_t *HsmClient, FirmwareUpdateReq_t *pFirmwareUpdateObject)
service request issued to HSM server to decrypt the firmware programmed in dormant flash bank in plac...
Definition: hsmclient.c:1959
DKEK_t
This is DKEK type which holds the label and context for derivation. This also holds the 256 derived K...
Definition: hsmclient.h:258
NvmOtpRead_t::rowIdx
uint16_t rowIdx
Definition: hsmclient.h:131
OTFA_Region_t::reservedArea
uint16_t reservedArea
Definition: hsmclient.h:323
SecureBoot_Stream_t_::canBeEncrypted
uint8_t canBeEncrypted
Definition: hsmclient.h:295
HsmClient_readOTPRow
int32_t HsmClient_readOTPRow(HsmClient_t *HsmClient, NvmOtpRead_t *readRow)
The service issued to HSM Server retrieves the data of GP OTP row based on row index provided as para...
Definition: hsmclient.c:795
NvmOtpRowWrite_t
This is an NvmOtpRowWrite type which holds the information regarding programming NvmOtp row....
Definition: hsmclient.h:143
HsmClient_readSWRev
int32_t HsmClient_readSWRev(HsmClient_t *HsmClient, SWRev_t *readSWRev)
The service issued to HSM Server retrieves the SWRevision value based on identifier as param.
Definition: hsmclient.c:1590
Hsmclient_loadHSMRtFirmwareNonBlocking
int32_t Hsmclient_loadHSMRtFirmwareNonBlocking(const uint8_t *pHSMRt_firmware)
Loads the HSMRt firmware but does wait for ROM response and boot notification. This is typically call...
Definition: hsmclient_loadhsmrt.c:404
HsmClient_importKeyring
int32_t HsmClient_importKeyring(HsmClient_t *HsmClient, uint8_t *cert, uint32_t cert_size, uint32_t timeout)
The service issued to HSM Server verifies the certificate and imports the keys from the certificate.
Definition: hsmclient.c:723
HsmVer_t_::HsmType
uint8_t HsmType
Definition: hsmclient.h:95
OTFA_Config_t::OTFA_Reg
OTFA_Region_t OTFA_Reg[4]
Definition: hsmclient.h:357
HsmClient_procAuthBootStart
int32_t HsmClient_procAuthBootStart(HsmClient_t *HsmClient, SecureBoot_Stream_t *secureBootInfo)
The service issued to HSM Server helps with extended secure boot for applications.
Definition: hsmclient.c:1203
RNGReq_t::seedValue
uint32_t * seedValue
Definition: hsmclient.h:281
HsmVer_t_::MajorVer
uint8_t MajorVer
Definition: hsmclient.h:91
FirewallIntrReq_t::firewallId
uint16_t firewallId
Definition: hsmclient.h:224
OTFA_Region_t::regionStAddr
uint32_t regionStAddr
Definition: hsmclient.h:324
OTFA_Region_t::regionIV
uint8_t regionIV[16]
Definition: hsmclient.h:331
FirewallReq_t::FirewallRegionArr
FirewallRegionReq_t * FirewallRegionArr
Definition: hsmclient.h:212
NvmOtpRowWrite_t::rowIdx
uint16_t rowIdx
Definition: hsmclient.h:146
FirmwareUpdateReq_t::pStartAddress
uint8_t * pStartAddress
Definition: hsmclient.h:308
FirewallRegionReq_t
This is a FirewallRegionReq type which holds the information of Firewall region configuration.
Definition: hsmclient.h:195
RNGReq_t::resultPtr
uint8_t * resultPtr
Definition: hsmclient.h:278
HsmClient_t
This is a HSMClient type which holds the information needed by hsm client to communicate with HSM .
Definition: hsmclient.h:111
HsmClient_UpdateKeyRevsion
int32_t HsmClient_UpdateKeyRevsion(HsmClient_t *HsmClient, uint32_t timeout)
service request issued to HSM server to update key revision to 0x2 which changes the root of trust ke...
Definition: hsmclient.c:2107
OTFA_Region_t::encrKeyFetchMode
uint8_t encrKeyFetchMode
Definition: hsmclient.h:328
NvmOtpRowProt_t
This is a NvmOtpRowProt type which holds the information of NvmOtp row index and protection status co...
Definition: hsmclient.h:170
HsmVer_t_::SocType
uint8_t SocType
Definition: hsmclient.h:93
HsmVer_t_::ApiVer
uint8_t ApiVer
Definition: hsmclient.h:92
SemaphoreP.h
HsmClient_procAuthBootFinish
int32_t HsmClient_procAuthBootFinish(HsmClient_t *HsmClient, SecureBoot_Stream_t *secureBootInfo)
The service issued to HSM Server helps with extended secure boot for applications.
Definition: hsmclient.c:1271
HsmVer_t_::HsmrtVer
uint64_t HsmrtVer
Definition: hsmclient.h:86
NvmOtpRowProt_t::writeProt
uint8_t writeProt
Definition: hsmclient.h:173
OTFA_Region_t::encrKeyID
uint8_t encrKeyID
Definition: hsmclient.h:327
sipc_notify.h
HsmVer_t_::DevType
uint8_t DevType
Definition: hsmclient.h:96
OTFA_readRegion_t::authMode
uint8_t authMode
Definition: hsmclient.h:341
RNGReq_t::seedSizeInDWords
uint8_t seedSizeInDWords
Definition: hsmclient.h:282
HsmClient_firmwareUpdate_CertProcess
int32_t HsmClient_firmwareUpdate_CertProcess(HsmClient_t *HsmClient, FirmwareUpdateReq_t *pFirmwareUpdateObject)
service request issued to HSM server to parse the certificate to validate authenticity and identify t...
Definition: hsmclient.c:1808
NvmOtpRowProt_t::readProt
uint8_t readProt
Definition: hsmclient.h:172
HsmClient_t::RespMsg
HsmMsg_t RespMsg
Definition: hsmclient.h:115
FirewallRegionReq_t::endAddress
uint32_t endAddress
Definition: hsmclient.h:200
HsmClient_openDbgFirewall
int32_t HsmClient_openDbgFirewall(HsmClient_t *HsmClient, uint8_t *cert, uint32_t cert_size, uint32_t timeout)
The service issued to HSM Server verifies the certificate and by default the hsm flag is set to HSM_F...
Definition: hsmclient.c:651
SWRev_t::revValue
uint32_t revValue
Definition: hsmclient.h:242
HsmClient_register
int32_t HsmClient_register(HsmClient_t *HsmClient, uint8_t clientId)
register a client to a particular ClientId
Definition: hsmclient.c:452
FirewallIntrReq_t
This is a FirewallIntrReq type which holds the information of MPU Firewall request for interrupt enab...
Definition: hsmclient.h:223
FirmwareUpdateReq_t::bankMode
uint32_t bankMode
Definition: hsmclient.h:310
NvmOtpRowWrite_t::rowBitMask
uint32_t rowBitMask
Definition: hsmclient.h:145
HsmClient_getOTPRowCount
int32_t HsmClient_getOTPRowCount(HsmClient_t *HsmClient, NvmOtpRowCount_t *rowCount)
The service issued to HSM Server retrieves the count of extended OTP rows.
Definition: hsmclient.c:997
HsmClient_VerifyROTSwitchingCertificate
int32_t HsmClient_VerifyROTSwitchingCertificate(HsmClient_t *HsmClient, uint8_t *cert, uint32_t cert_size, uint32_t timeout)
service request issued to HSM server to validate RoT Switching Certificate
Definition: hsmclient.c:2037
NvmOtpRead_t::rowData
uint32_t rowData
Definition: hsmclient.h:130
FirewallReq_t
This is a FirewallReq_t type which holds the information of Firewall configuration.
Definition: hsmclient.h:209
FirewallIntrReq_t::interruptEnableClear
uint8_t interruptEnableClear
Definition: hsmclient.h:226
FirewallRegionReq_t::permissionAttributes
uint32_t permissionAttributes
Definition: hsmclient.h:198
OTFA_readRegion_t::regionIV
uint16_t regionIV[16]
Definition: hsmclient.h:347
NvmOtpRowProt_t::rowidx
uint16_t rowidx
Definition: hsmclient.h:171
HsmClient_init
int32_t HsmClient_init(SIPC_Params *params)
Initialize the HSM client for current core.
Definition: hsmclient.c:482
HsmClient_FirewallIntr
int32_t HsmClient_FirewallIntr(HsmClient_t *HsmClient, FirewallIntrReq_t *FirewallIntrReqObj, uint32_t timeout)
The service issued to HSM Server sets the firewall interrupt request for the given firewall id.
Definition: hsmclient.c:1385
SWRev_t
This is SWRev type which holds the information regarding Revision identifier and value corresponding ...
Definition: hsmclient.h:241
HsmVer_t_::BinType
uint8_t BinType
Definition: hsmclient.h:94
FirewallRegionReq_t::startAddress
uint32_t startAddress
Definition: hsmclient.h:199
HsmVer_t_::VerStruct
struct HsmVer_t_::@0 VerStruct
OTFA_Region_t::encMode
uint8_t encMode
Definition: hsmclient.h:322
SecureBoot_Stream_t_::dataLen
uint32_t dataLen
Definition: hsmclient.h:294
FirewallReq_t::statusFirewallRegionArr
uint16_t statusFirewallRegionArr
Definition: hsmclient.h:213
FirewallReq_t::regionCount
uint16_t regionCount
Definition: hsmclient.h:210
OTFA_readRegion_t::encKeyHash
uint8_t encKeyHash[64]
Definition: hsmclient.h:344
DKEK_t::context_length
uint8_t context_length
Definition: hsmclient.h:260
HsmClient_readOTFARegions
int32_t HsmClient_readOTFARegions(HsmClient_t *HsmClient, OTFA_readRegion_t *OTFA_readRegion, uint32_t timeout)
Client request to read the OTFA regions.
Definition: hsmclient.c:2226
SWRev_t::revId
uint8_t revId
Definition: hsmclient.h:243
OTFA_readRegion_t::regionStAddr
uint32_t regionStAddr
Definition: hsmclient.h:345
HsmClient_unregister
void HsmClient_unregister(HsmClient_t *HsmClient, uint8_t clientId)
unregister a client to a particular ClientId
Definition: hsmclient.c:508
FirewallIntrReq_t::faultClear
uint8_t faultClear
Definition: hsmclient.h:228
OTFA_readRegion_t::regionSize
uint32_t regionSize
Definition: hsmclient.h:346
hsmclient_msg.h
FirmwareUpdateReq_t::dataLength
uint32_t dataLength
Definition: hsmclient.h:309
FirewallIntrReq_t::interruptEnable
uint8_t interruptEnable
Definition: hsmclient.h:225
KeyWriterCertHeader_t::certAddress
uint8_t * certAddress
Definition: hsmclient.h:183
NvmOtpRowWrite_t::rowData
uint32_t rowData
Definition: hsmclient.h:144
Hsmclient_loadHSMRtFirmware
int32_t Hsmclient_loadHSMRtFirmware(HsmClient_t *gHSMClient, const uint8_t *pHSMRt_firmware)
Loads the HSMRt firmware. This is typically called by SBL.
Definition: hsmclient_loadhsmrt.c:323
OTFA_readRegion_t::authKeyHash
uint8_t authKeyHash[64]
Definition: hsmclient.h:343
HsmClient_procAuthBootUpdate
int32_t HsmClient_procAuthBootUpdate(HsmClient_t *HsmClient, SecureBoot_Stream_t *secureBootInfo)
The service issued to HSM Server helps with extended secure boot for applications.
Definition: hsmclient.c:1237
NvmOtpRowCount_t
This is an NvmOtpRowCount type which holds the information regarding NvmOtp row count and size of eac...
Definition: hsmclient.h:156
HsmClient_getOTPRowProtection
int32_t HsmClient_getOTPRowProtection(HsmClient_t *HsmClient, NvmOtpRowProt_t *rowProt)
The service issued to HSM Server retrieves the extended otp efuse row protection status....
Definition: hsmclient.c:1064
OTFA_readRegion_t
This is the OTFA Region structure which holds individual region specific information to be read from ...
Definition: hsmclient.h:339
HsmClient_waitForBootNotify
int32_t HsmClient_waitForBootNotify(HsmClient_t *HsmClient, uint32_t timeToWaitInTicks)
Current core will wait for bootnotify message from HSM core.
HsmClient_t::Semaphore
SemaphoreP_Object Semaphore
Definition: hsmclient.h:112
HsmClient_lockOTPRow
int32_t HsmClient_lockOTPRow(HsmClient_t *HsmClient, NvmOtpRowProt_t *rowProt)
The service issued to HSM Server sets the protection status bit of the specified row to 1....
Definition: hsmclient.c:930
HsmClient_writeOTPRow
int32_t HsmClient_writeOTPRow(HsmClient_t *HsmClient, NvmOtpRowWrite_t *writeRow)
The service issued to HSM Server writes the data to extended OTP efuse row based on row index provide...
Definition: hsmclient.c:863
HsmVer_t_::MinorVer
uint8_t MinorVer
Definition: hsmclient.h:90
FirewallRegionReq_t::firewallId
uint16_t firewallId
Definition: hsmclient.h:196
RNGReq_t::resultLengthPtr
uint32_t * resultLengthPtr
Definition: hsmclient.h:279
HsmClient_getUID
int32_t HsmClient_getUID(HsmClient_t *HsmClient, uint8_t *uid, uint32_t timeout)
The service issued to HSM Server populates the Device UID by default the hsm flag is set to HSM_FLAG_...
Definition: hsmclient.c:583
OTFA_Config_t::masterEnable
uint8_t masterEnable
Definition: hsmclient.h:361
HsmClient_keyWriter
int32_t HsmClient_keyWriter(HsmClient_t *HsmClient, KeyWriterCertHeader_t *certHeader, uint32_t timeout)
The service issued to HSM Server verifies the certificate and process the keywriter operations,...
Definition: hsmclient.c:1520
OTFA_Region_t::authMode
uint8_t authMode
Definition: hsmclient.h:321
OTFA_Config_t::macSize
uint8_t macSize
Definition: hsmclient.h:360
HsmClient_t::ClientId
uint8_t ClientId
Definition: hsmclient.h:117
SemaphoreP_Object
Opaque semaphore object used with the semaphore APIs.
Definition: SemaphoreP.h:59
HsmClient_getRandomNum
int32_t HsmClient_getRandomNum(HsmClient_t *HsmClient, RNGReq_t *getRandomNum)
Returns the Random Number Generated.
Definition: hsmclient.c:1726
KeyWriterCertHeader_t::debugResponse
uint32_t debugResponse
Definition: hsmclient.h:185
HsmClient_getDKEK
int32_t HsmClient_getDKEK(HsmClient_t *HsmClient, DKEK_t *getDKEK, uint32_t timeout)
The service issued to HSM Server retrieves the derived KEK based on identifier as param.
Definition: hsmclient.c:1453
RNGReq_t::reserved
uint8_t reserved
Definition: hsmclient.h:283
HsmClient_configOTFARegions
int32_t HsmClient_configOTFARegions(HsmClient_t *HsmClient, OTFA_Config_t *OTFA_ConfigInfo, uint32_t timeout)
Client request to configure the OTFA regions.
Definition: hsmclient.c:2158
KeyWriterCertHeader_t::reserved
uint32_t reserved
Definition: hsmclient.h:186
OTFA_Region_t::authKeyID
uint8_t authKeyID
Definition: hsmclient.h:326
NvmOtpRowCount_t::rowCount
uint32_t rowCount
Definition: hsmclient.h:157
OTFA_Region_t::regionSize
uint32_t regionSize
Definition: hsmclient.h:325
FirmwareUpdateReq_t
This is Firmware Update request structure passed to HSM core via SIPC as argument,...
Definition: hsmclient.h:307
DKEK_t::label_length
uint8_t label_length
Definition: hsmclient.h:259
__attribute__
union HsmVer_t_ __attribute__((packed)) HsmVer_t
type for reading HSMRt version.
KeyWriterCertHeader_t
This is a keywriter_cert_header type which holds the information of customer key certificate and debu...
Definition: hsmclient.h:182
HsmClient_SecureBootQueueInit
void HsmClient_SecureBootQueueInit(uint32_t configured_hsm_client_msg_queue_size)
Customize the size of the HSM client message queue.
Definition: hsmclient.c:497
FirewallIntrReq_t::interruptEnableStatusClear
uint8_t interruptEnableStatusClear
Definition: hsmclient.h:227
OTFA_readRegion_t::regionNumber
uint8_t regionNumber
Definition: hsmclient.h:340
FirewallReq_t::crcArr
uint16_t crcArr
Definition: hsmclient.h:211
RNGReq_t
This is RNG type which holds the resultPtr for derivation which is returned by TIFS....
Definition: hsmclient.h:277
OTFA_Config_t::numRegions
uint8_t numRegions
Definition: hsmclient.h:358
HsmClient_procAuthBoot
int32_t HsmClient_procAuthBoot(HsmClient_t *HsmClient, uint8_t *cert, uint32_t cert_size, uint32_t timeout)
The service issued to HSM Server helps with extended secure boot for applications.
Definition: hsmclient.c:1131
HsmClient_getVersion
int32_t HsmClient_getVersion(HsmClient_t *HsmClient, HsmVer_t *verId, uint32_t timeToWaitInTick)
populates the current HSMRT version Id by default the hsm flag is set to HSM_FLAG_AOP for this servic...
Definition: hsmclient.c:514
OTFA_Region_t
This is the OTFA Region structure which holds individual region specific information to be written to...
Definition: hsmclient.h:320
RNGReq_t::DRBGMode
uint8_t DRBGMode
Definition: hsmclient.h:280
OTFA_Region_t::authAesKey
uint8_t authAesKey[16]
Definition: hsmclient.h:329
hsmclient_utils.h
HsmClient_t::ReqMsg
HsmMsg_t ReqMsg
Definition: hsmclient.h:114
NvmOtpRead_t
This is an NvmOtpRead type which holds the information of NvmOtp row index and row data corresponding...
Definition: hsmclient.h:129
HsmClient_deInit
void HsmClient_deInit(void)
De initialize the HSM client for current core.