Skip to content

Commit 217440c

Browse files
committed
Add wolfcrypt/src/wolfssl_sources.h and wolfcrypt/src/wolfssl_sources_asm.h,
which force on BUILDING_WOLFSSL and do boilerplate includes, and update library sources to include them at the top. wolfssl_sources.h includes types.h, error-crypt.h, and logging.h, and conditionally, config.h. settings.h and wc_port.h are unconditionally included at the top of types.h. wolfssl_sources_asm.h includes settings.h, and conditionally, config.h. Add wolfssl_sources*.h to wolfcrypt/src/include.am, and to several IDE/ project files. Also added a TEST_WOLFSSL_SOURCES_INCLUSION_SEQUENCE clause in wolfssl/wolfcrypt/settings.h to allow coverage testing. In wolfcrypt/src/misc.c, retain existing ad hoc boilerplate includes, and use them if WOLFSSL_VIS_FOR_TESTS, otherwise include the new wolfssl_sources.h. Define WOLFSSL_VIS_FOR_TESTS at top of wolfcrypt/test/test.c. Also renamed WOLFSSL_NEED_LINUX_CURRENT to WOLFSSL_LINUXKM_NEED_LINUX_CURRENT, for clarity.
1 parent 10a1126 commit 217440c

181 files changed

Lines changed: 335 additions & 1208 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

IDE/ECLIPSE/DEOS/deos_wolfssl/.project

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -609,6 +609,16 @@
609609
<type>1</type>
610610
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/wolfmath.c</locationURI>
611611
</link>
612+
<link>
613+
<name>wolfcrypt/src/wolfssl_sources.h</name>
614+
<type>1</type>
615+
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/wolfssl_sources.h</locationURI>
616+
</link>
617+
<link>
618+
<name>wolfcrypt/src/wolfssl_sources_asm.h</name>
619+
<type>1</type>
620+
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/wolfssl_sources_asm.h</locationURI>
621+
</link>
612622
</linkedResources>
613623
<variableList>
614624
<variable>

IDE/XilinxSDK/2019_2/wolfCrypt_example/.project

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -705,6 +705,16 @@
705705
<type>1</type>
706706
<locationURI>PARENT-4-PROJECT_LOC/wolfcrypt/src/wolfmath.c</locationURI>
707707
</link>
708+
<link>
709+
<name>src/wolfcrypt/src/wolfssl_sources.h</name>
710+
<type>1</type>
711+
<locationURI>PARENT-4-PROJECT_LOC/wolfcrypt/src/wolfssl_sources.h</locationURI>
712+
</link>
713+
<link>
714+
<name>src/wolfcrypt/src/wolfssl_sources_asm.h</name>
715+
<type>1</type>
716+
<locationURI>PARENT-4-PROJECT_LOC/wolfcrypt/src/wolfssl_sources_asm.h</locationURI>
717+
</link>
708718
<link>
709719
<name>src/wolfcrypt/test/README.md</name>
710720
<type>1</type>

IDE/XilinxSDK/2022_1/wolfCrypt_FreeRTOS_example/.project

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1400,6 +1400,16 @@
14001400
<type>1</type>
14011401
<locationURI>PARENT-3-WORKSPACE_LOC/wolfcrypt/src/wolfmath.c</locationURI>
14021402
</link>
1403+
<link>
1404+
<name>src/wolfcrypt/src/wolfssl_sources.h</name>
1405+
<type>1</type>
1406+
<locationURI>PARENT-3-WORKSPACE_LOC/wolfcrypt/src/wolfssl_sources.h</locationURI>
1407+
</link>
1408+
<link>
1409+
<name>src/wolfcrypt/src/wolfssl_sources_asm.h</name>
1410+
<type>1</type>
1411+
<locationURI>PARENT-3-WORKSPACE_LOC/wolfcrypt/src/wolfssl_sources_asm.h</locationURI>
1412+
</link>
14031413
<link>
14041414
<name>src/wolfcrypt/test/test.c</name>
14051415
<type>1</type>

IDE/XilinxSDK/2022_1/wolfCrypt_example/.project

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1400,6 +1400,16 @@
14001400
<type>1</type>
14011401
<locationURI>PARENT-3-WORKSPACE_LOC/wolfcrypt/src/wolfmath.c</locationURI>
14021402
</link>
1403+
<link>
1404+
<name>src/wolfcrypt/src/wolfssl_sources.h</name>
1405+
<type>1</type>
1406+
<locationURI>PARENT-3-WORKSPACE_LOC/wolfcrypt/src/wolfssl_sources.h</locationURI>
1407+
</link>
1408+
<link>
1409+
<name>src/wolfcrypt/src/wolfssl_sources_asm.h</name>
1410+
<type>1</type>
1411+
<locationURI>PARENT-3-WORKSPACE_LOC/wolfcrypt/src/wolfssl_sources_asm.h</locationURI>
1412+
</link>
14031413
<link>
14041414
<name>src/wolfcrypt/test/test.c</name>
14051415
<type>1</type>

linuxkm/linuxkm_wc_port.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -855,7 +855,7 @@
855855
/* remove this multifariously conflicting macro, picked up from
856856
* Linux arch/<arch>/include/asm/current.h.
857857
*/
858-
#ifndef WOLFSSL_NEED_LINUX_CURRENT
858+
#ifndef WOLFSSL_LINUXKM_NEED_LINUX_CURRENT
859859
#undef current
860860
#endif
861861

linuxkm/module_exports.c.template

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,12 @@
2020
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
2121
*/
2222

23-
#ifdef HAVE_CONFIG_H
24-
#include <config.h>
25-
#endif
26-
27-
#include <wolfssl/wolfcrypt/settings.h>
23+
#include "../wolfcrypt/src/wolfssl_sources.h"
2824

2925
#ifdef HAVE_FIPS
3026
#define FIPS_NO_WRAPPERS
3127
#endif
3228

33-
#include <wolfssl/wolfcrypt/error-crypt.h>
3429
#ifndef WOLFCRYPT_ONLY
3530
#include <wolfssl/ssl.h>
3631
#include <wolfssl/internal.h>

linuxkm/module_hooks.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,10 @@
2929

3030
#define FIPS_NO_WRAPPERS
3131

32-
#define WOLFSSL_NEED_LINUX_CURRENT
32+
#define WOLFSSL_LINUXKM_NEED_LINUX_CURRENT
3333

34-
#ifdef HAVE_CONFIG_H
35-
#include <config.h>
36-
#endif
34+
#include "../wolfcrypt/src/wolfssl_sources.h"
3735

38-
#include <wolfssl/wolfcrypt/settings.h>
39-
#include <wolfssl/wolfcrypt/error-crypt.h>
4036
#ifdef WOLFCRYPT_ONLY
4137
#include <wolfssl/version.h>
4238
#else

linuxkm/pie_first.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,8 @@
2323
#error pie_first.c must be compiled -fPIE.
2424
#endif
2525

26-
#ifdef HAVE_CONFIG_H
27-
#include <config.h>
28-
#endif
26+
#include "../wolfcrypt/src/wolfssl_sources.h"
2927

30-
#include <wolfssl/wolfcrypt/settings.h>
31-
#include <wolfssl/wolfcrypt/error-crypt.h>
3228
#include <wolfssl/ssl.h>
3329

3430
int wolfCrypt_PIE_first_function(void);

linuxkm/pie_last.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,8 @@
2323
#error pie_last.c must be compiled -fPIE.
2424
#endif
2525

26-
#ifdef HAVE_CONFIG_H
27-
#include <config.h>
28-
#endif
26+
#include "../wolfcrypt/src/wolfssl_sources.h"
2927

30-
#include <wolfssl/wolfcrypt/settings.h>
31-
#include <wolfssl/wolfcrypt/error-crypt.h>
3228
#include <wolfssl/ssl.h>
3329

3430
int wolfCrypt_PIE_last_function(void);

linuxkm/pie_redirect_table.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,8 @@
2323
#error pie_redirect_table.c must be compiled -fPIE.
2424
#endif
2525

26-
#ifdef HAVE_CONFIG_H
27-
#include <config.h>
28-
#endif
26+
#include "../wolfcrypt/src/wolfssl_sources.h"
2927

30-
#include <wolfssl/wolfcrypt/settings.h>
31-
#include <wolfssl/wolfcrypt/error-crypt.h>
3228
#include <wolfssl/ssl.h>
3329

3430
/* compiling -fPIE results in references to the GOT or equivalent thereof, which remain after linking

0 commit comments

Comments
 (0)