Skip to content

Commit

Permalink
Merge pull request #64 from billphipps/unify_settings
Browse files Browse the repository at this point in the history
Update to ensure wh_settings.h is being included in c files.
  • Loading branch information
bigbrett authored Aug 12, 2024
2 parents 5d72558 + b28819e commit b1218c0
Show file tree
Hide file tree
Showing 24 changed files with 69 additions and 17 deletions.
6 changes: 4 additions & 2 deletions src/wh_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
*
*/

/* Pick up compile-time configuration */
#include "wolfhsm/wh_settings.h"

/* System libraries */
#include <stdint.h>
#include <stddef.h> /* For NULL */
Expand All @@ -44,8 +47,7 @@
#include "wolfssl/wolfcrypt/ecc.h"

#include "wolfhsm/wh_client_cryptocb.h"

#endif
#endif /* WOLFHSM_CFG_NO_CRYPTO */

/* Message definitions */
#include "wolfhsm/wh_message.h"
Expand Down
3 changes: 3 additions & 0 deletions src/wh_client_cryptocb.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@

#include <stdint.h>

/* Pick up compile-time configuration */
#include "wolfhsm/wh_settings.h"

#include "wolfhsm/wh_client.h"
#include "wolfhsm/wh_comm.h"
#include "wolfhsm/wh_packet.h"
Expand Down
3 changes: 3 additions & 0 deletions src/wh_client_nvm.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
#include <stddef.h> /* For NULL */
#include <string.h> /* For memset, memcpy */

/* Pick up compile-time configuration */
#include "wolfhsm/wh_settings.h"

/* Common WolfHSM types and defines shared with the server */
#include "wolfhsm/wh_common.h"
#include "wolfhsm/wh_error.h"
Expand Down
3 changes: 2 additions & 1 deletion src/wh_client_she.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
*/


#include "wolfhsm/wh_client.h"
/* Pick up compile-time configuration */
#include "wolfhsm/wh_settings.h"

#ifdef WOLFHSM_CFG_SHE_EXTENSION

Expand Down
2 changes: 2 additions & 0 deletions src/wh_comm.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
*
*/

/* Pick up compile-time configuration */
#include "wolfhsm/wh_settings.h"

#include <stdint.h> /* For sized ints */
#include <stddef.h>
Expand Down
3 changes: 3 additions & 0 deletions src/wh_flash_ramsim.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
*
*/

/* Pick up compile-time configuration */
#include "wolfhsm/wh_settings.h"

#include <stdint.h>
#include <stddef.h> /* For NULL */
#include <stdlib.h> /* For malloc/free */
Expand Down
3 changes: 3 additions & 0 deletions src/wh_flash_unit.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
*
*/

/* Pick up compile-time configuration */
#include "wolfhsm/wh_settings.h"

#include <stdint.h>
#include <stddef.h> /* For NULL */
#include <string.h> /* For memset, memcpy */
Expand Down
3 changes: 3 additions & 0 deletions src/wh_message_comm.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
* src/wh_message_comm.c
*/

/* Pick up compile-time configuration */
#include "wolfhsm/wh_settings.h"

#include <stdint.h>
#include <stddef.h>
#include <string.h>
Expand Down
3 changes: 3 additions & 0 deletions src/wh_message_customcb.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
*
*/

/* Pick up compile-time configuration */
#include "wolfhsm/wh_settings.h"

#include <stddef.h>
#include <stdint.h>
#include <string.h>
Expand Down
3 changes: 3 additions & 0 deletions src/wh_message_nvm.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
*
*/

/* Pick up compile-time configuration */
#include "wolfhsm/wh_settings.h"

#include <stdint.h>
#include <stddef.h>
#include <string.h>
Expand Down
3 changes: 3 additions & 0 deletions src/wh_nvm.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
*
*/

/* Pick up compile-time configuration */
#include "wolfhsm/wh_settings.h"

#include <stdint.h>
#include <stddef.h> /* For NULL */
#include <string.h> /* For memset, memcpy */
Expand Down
3 changes: 3 additions & 0 deletions src/wh_nvm_flash.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
*
*/

/* Pick up compile-time configuration */
#include "wolfhsm/wh_settings.h"

#include <stdint.h>
#include <stddef.h> /* For NULL */
#include <string.h> /* For memset, memcpy */
Expand Down
3 changes: 3 additions & 0 deletions src/wh_server.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
*
*/

/* Pick up compile-time configuration */
#include "wolfhsm/wh_settings.h"

/* System libraries */
#include <stdint.h>
#include <stddef.h> /* For NULL */
Expand Down
3 changes: 3 additions & 0 deletions src/wh_server_counter.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
*
*/

/* Pick up compile-time configuration */
#include "wolfhsm/wh_settings.h"

#include <string.h>
#include <stdint.h>

Expand Down
4 changes: 2 additions & 2 deletions src/wh_server_crypto.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
*
*/

/* Pick up server config */
#include "wolfhsm/wh_server.h"
/* Pick up compile-time configuration */
#include "wolfhsm/wh_settings.h"

/* System libraries */
#include <stdint.h>
Expand Down
4 changes: 2 additions & 2 deletions src/wh_server_customcb.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
*
*/

/* Pick up server config */
#include "wolfhsm/wh_server.h"
/* Pick up compile-time configuration */
#include "wolfhsm/wh_settings.h"

#include <stdint.h>
#include <stddef.h>
Expand Down
5 changes: 3 additions & 2 deletions src/wh_server_dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,15 @@
* src/wh_server_dma.c
*/

/* Pick up server config */
#include "wolfhsm/wh_server.h"
/* Pick up compile-time configuration */
#include "wolfhsm/wh_settings.h"

#include <stdint.h>
#include <string.h>
#include <stddef.h>

#include "wolfhsm/wh_error.h"
#include "wolfhsm/wh_server.h"


/* TODO: if the Address allowlist ever gets large, we should consider a more
Expand Down
6 changes: 4 additions & 2 deletions src/wh_server_keystore.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
*
*/

/* Pick up server config */
#include "wolfhsm/wh_server.h"
/* Pick up compile-time configuration */
#include "wolfhsm/wh_settings.h"

/* System libraries */
#include <stdint.h>
Expand All @@ -39,10 +39,12 @@
#include "wolfhsm/wh_error.h"
#include "wolfhsm/wh_message.h"
#include "wolfhsm/wh_packet.h"
#include "wolfhsm/wh_server.h"

#ifdef WOLFHSM_CFG_SHE_EXTENSION
#include "wolfhsm/wh_server_she.h"
#endif

#include "wolfhsm/wh_server_keystore.h"

int hsmGetUniqueId(whServerContext* server, whNvmId* outId)
Expand Down
5 changes: 3 additions & 2 deletions src/wh_server_nvm.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
*
*/

/* Pick up server config */
#include "wolfhsm/wh_server.h"
/* Pick up compile-time configuration */
#include "wolfhsm/wh_settings.h"

/* System libraries */
#include <stdint.h>
Expand All @@ -38,6 +38,7 @@
#include "wolfhsm/wh_message.h"
#include "wolfhsm/wh_message_nvm.h"

#include "wolfhsm/wh_server.h"
#include "wolfhsm/wh_server_nvm.h"

int wh_Server_HandleNvmRequest(whServerContext* server,
Expand Down
6 changes: 3 additions & 3 deletions src/wh_server_she.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,19 @@
*
*/


/* Pick up compile-time configuration */
#include "wolfhsm/wh_settings.h"

/* System libraries */
#include <stdint.h>
#include <stddef.h> /* For NULL */
#include <string.h> /* For memset, memcpy */


#include "wolfhsm/wh_server.h"
#include "wolfhsm/wh_message.h"
#include "wolfhsm/wh_packet.h"
#include "wolfhsm/wh_error.h"
#include "wolfhsm/wh_utils.h"
#include "wolfhsm/wh_server.h"

#ifndef WOLFHSM_CFG_NO_CRYPTO
#include "wolfssl/wolfcrypt/settings.h"
Expand Down
1 change: 1 addition & 0 deletions src/wh_she_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#include "wolfhsm/wh_error.h"
#include "wolfhsm/wh_utils.h"

#include "wolfhsm/wh_she_common.h"

typedef struct {
uint32_t count;
Expand Down
3 changes: 3 additions & 0 deletions src/wh_transport_mem.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
* Implementation of transport callbacks using 2 memory blocks
*/

/* Pick up compile-time configuration */
#include "wolfhsm/wh_settings.h"

#include <stddef.h>
#include <string.h>
#include <stdint.h>
Expand Down
3 changes: 3 additions & 0 deletions src/wh_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
*
*/

/* Pick up compile-time configuration */
#include "wolfhsm/wh_settings.h"

#include <stdint.h>

#include "wolfhsm/wh_utils.h"
Expand Down
5 changes: 4 additions & 1 deletion test/wh_test_crypto.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
*
*/

#include "wolfhsm/wh_settings.h"

#include <stdint.h>
#include <stdio.h> /* For printf */
#include <string.h> /* For memset, memcpy */
Expand All @@ -36,8 +38,9 @@
#include "wolfhsm/wh_flash_ramsim.h"
#include "wolfhsm/wh_comm.h"
#include "wolfhsm/wh_message.h"
#include "wolfhsm/wh_server.h"
#include "wolfhsm/wh_client.h"
#include "wolfhsm/wh_server.h"

#include "wolfhsm/wh_transport_mem.h"

#include "wh_test_common.h"
Expand Down

0 comments on commit b1218c0

Please sign in to comment.