Skip to content

Commit bcdac71

Browse files
committed
fix keywrap macro protection to avoid unused function warnings
1 parent ef5c31e commit bcdac71

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/wh_server_keystore.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ static int _FindInCache(whServerContext* server, whKeyId keyId, int* out_index,
5353
whNvmMetadata** out_meta);
5454

5555
#ifdef WOLFHSM_CFG_GLOBAL_KEYS
56-
/**
56+
/*
5757
* @brief Check if keyId represents a global key (USER == 0)
5858
*/
5959
static int _IsGlobalKey(whKeyId keyId)
@@ -62,7 +62,7 @@ static int _IsGlobalKey(whKeyId keyId)
6262
}
6363
#endif /* WOLFHSM_CFG_GLOBAL_KEYS */
6464

65-
/**
65+
/*
6666
* @brief Get the appropriate cache context based on keyId
6767
*
6868
* When WOLFHSM_CFG_GLOBAL_KEYS is enabled, routes to global cache if keyId
@@ -82,7 +82,8 @@ static whKeyCacheContext* _GetCacheContext(whServerContext* server,
8282
return &server->localCache;
8383
}
8484

85-
/**
85+
#ifdef WOLFHSM_CFG_KEYWRAP
86+
/*
8687
* @brief Retrieve the wrapped-key registry associated with keyId
8788
*/
8889
static whWrappedKeyRegistry* _GetWrappedRegistry(whServerContext* server,
@@ -171,6 +172,7 @@ static int _IsKnownWrappedKey(whServerContext* server, whKeyId keyId)
171172
/* Registry stores client-relative IDs, so pass extracted ID */
172173
return _WrappedRegistryContains(registry, (whKeyId)clientRelativeId);
173174
}
175+
#endif /* WOLFHSM_CFG_KEYWRAP */
174176

175177
/**
176178
* @brief Find a key in the specified cache context

0 commit comments

Comments
 (0)