@@ -98,6 +98,7 @@ static int _showNvm(whClientContext* clientContext)
9898
9999static int _provisionMakeCommitKey (whClientContext * clientContext )
100100{
101+ #ifndef WOLFHSM_CFG_NO_CRYPTO
101102 int ret ;
102103
103104 /* Use the default ECC curve for 32 byte key, likely P256r1 */
@@ -112,10 +113,15 @@ static int _provisionMakeCommitKey(whClientContext* clientContext)
112113 ret = wh_Client_KeyCommit (clientContext , prov_keyId );
113114 }
114115 return ret ;
116+ #else
117+ (void )clientContext ;
118+ return WH_ERROR_NOTIMPL ;
119+ #endif
115120}
116121
117122static int _sha256File (const char * file_to_measure , uint8_t * hash )
118123{
124+ #ifndef WOLFHSM_CFG_NO_CRYPTO
119125 int ret = 0 ;
120126 int fd = open (file_to_measure , O_RDONLY );
121127 if (fd >= 0 ) {
@@ -149,11 +155,17 @@ static int _sha256File(const char* file_to_measure, uint8_t* hash)
149155 ret = WH_ERROR_BADARGS ;
150156 }
151157 return ret ;
158+ #else
159+ (void )file_to_measure ;
160+ (void )hash ;
161+ return WH_ERROR_NOTIMPL ;
162+ #endif
152163}
153164
154165static int _signHash (const uint8_t * hash , size_t hash_len , uint8_t * sig ,
155166 uint16_t * sig_len )
156167{
168+ #ifndef WOLFHSM_CFG_NO_CRYPTO
157169 ecc_key key [1 ];
158170 int ret = wc_ecc_init_ex (key , NULL , WH_DEV_ID );
159171 if (ret == 0 ) {
@@ -169,11 +181,19 @@ static int _signHash(const uint8_t* hash, size_t hash_len, uint8_t* sig,
169181 (void )wc_ecc_free (key );
170182 }
171183 return ret ;
184+ #else
185+ (void )hash ;
186+ (void )hash_len ;
187+ (void )sig ;
188+ (void )sig_len ;
189+ return WH_ERROR_NOTIMPL ;
190+ #endif
172191}
173192
174193static int _verifyHash (const uint8_t * hash , size_t hash_len , const uint8_t * sig ,
175194 uint16_t sig_len , int32_t * rc )
176195{
196+ #ifndef WOLFHSM_CFG_NO_CRYPTO
177197 ecc_key key [1 ];
178198 int ret = wc_ecc_init_ex (key , NULL , WH_DEV_ID );
179199 if (ret == 0 ) {
@@ -189,6 +209,14 @@ static int _verifyHash(const uint8_t* hash, size_t hash_len, const uint8_t* sig,
189209 (void )wc_ecc_free (key );
190210 }
191211 return ret ;
212+ #else
213+ (void )hash ;
214+ (void )hash_len ;
215+ (void )sig ;
216+ (void )sig_len ;
217+ (void )rc ;
218+ return WH_ERROR_NOTIMPL ;
219+ #endif
192220}
193221
194222int wh_DemoClient_SecBoot_Provision (whClientContext * clientContext )
0 commit comments