@@ -344,6 +344,7 @@ static int _FindInCache(whServerContext* server, whKeyId keyId, int* out_index,
344344 return ret ;
345345}
346346
347+ #ifdef WOLFHSM_CFG_KEYWRAP
347348static int _ExistsInCache (whServerContext * server , whKeyId keyId )
348349{
349350 int ret = 0 ;
@@ -364,6 +365,8 @@ static int _ExistsInCache(whServerContext* server, whKeyId keyId)
364365 return 1 ;
365366}
366367
368+ #endif /* WOLFHSM_CFG_KEYWRAP */
369+
367370/* try to put the specified key into cache if it isn't already, return pointers
368371 * to meta and the cached data*/
369372int wh_Server_KeystoreFreshenKey (whServerContext * server , whKeyId keyId ,
@@ -551,6 +554,7 @@ int wh_Server_KeystoreEraseKey(whServerContext* server, whNvmId keyId)
551554 return wh_Nvm_DestroyObjects (server -> nvm , 1 , & keyId );
552555}
553556
557+ #ifdef WOLFHSM_CFG_KEYWRAP
554558#ifndef NO_AES
555559#ifdef HAVE_AESGCM
556560
@@ -898,6 +902,8 @@ _HandleUnwrapAndCacheKeyRequest(whServerContext* server,
898902 return wh_Server_KeystoreCacheKey (server , & metadata , key );
899903}
900904
905+ #endif /* WOLFHSM_CFG_KEYWRAP */
906+
901907int wh_Server_HandleKeyRequest (whServerContext * server , uint16_t magic ,
902908 uint16_t action , uint16_t req_size ,
903909 const void * req_packet , uint16_t * out_resp_size ,
@@ -1180,6 +1186,8 @@ int wh_Server_HandleKeyRequest(whServerContext* server, uint16_t magic,
11801186 * out_resp_size = sizeof (resp );
11811187 }
11821188 } break ;
1189+
1190+ #ifdef WOLFHSM_CFG_KEYWRAP
11831191 case WH_KEY_WRAP : {
11841192 whMessageKeystore_WrapRequest wrapReq = {0 };
11851193 whMessageKeystore_WrapResponse wrapResp = {0 };
@@ -1290,6 +1298,8 @@ int wh_Server_HandleKeyRequest(whServerContext* server, uint16_t magic,
12901298
12911299 } break ;
12921300
1301+ #endif /* WOLFHSM_CFG_KEYWRAP */
1302+
12931303 default :
12941304 ret = WH_ERROR_BADARGS ;
12951305 break ;
0 commit comments