Topic: Wolfssl_test build error

Hi

I am trying to implement wollfssl on nrf5340dk by using the wolfssl zephyr port.
I have taken "wolfssl_test" example in which I am getting compilation errors

nrf5340_toolchain_2_1_0\v2.2.0\modules\crypto\wolfssl\wolfcrypt\src\sp_arm32.c:237:26: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'asm'

nrf5340_toolchain_2_1_0\v2.2.0\modules\crypto\wolfssl\wolfcrypt\src\sp_arm32.c:2676:21: error: 'r' undeclared (first use in this function)
2676 |         : [r] "+r" (r), [a] "+r" (a), [b ] "+r" (b)

I get many errors further in the file with the similar 'asm' undefined.

While reading on the internet somewhere I read that only the g++ compiler supports the asm attribute.
So for a trial I added this definition at the beginning of sp_arm32.c

#define asm __asm__   

which resolved the complation issues and the project was built successfully.

Just wanted clarify if the above code is a valid approach or am I missing a necessary configuration in the project?

Share

Re: Wolfssl_test build error

Hi ajmal,

Yes, that is certainly a valid approach.  But of course, you should not need any workarounds ideally.
Can you please confirm which wolfSSL version you're on, and what toolchain you're using?  This will assist us in fixing this upstream.

Thanks,
Kareem

Share

Re: Wolfssl_test build error

Hi Kareem,

I am using wolfSSL-5.5.4 version
toolchain is "nrf connect SDK" version v2.2.0

Share

Re: Wolfssl_test build error

Hi,

    I am trying to run the example code "wolfssl_ts_sock" on the zephyr port on the nrf5340 device.
    But the application fails to load the CA certificate and following error is printed on the console
    ERROR: failed to load CA certificate
    Client return -1
    Client memory stats
    static memory was not used with sslDone
    Server return -1
    Server memory Stats

    My user_configuration is
   
#undef  WOLFSSL_ZEPHYR
#define WOLFSSL_ZEPHYR

#if 0
#undef  SINGLE_THREADED
#define SINGLE_THREADED
#endif

#undef  TFM_TIMING_RESISTANT
#define TFM_TIMING_RESISTANT

#undef  ECC_TIMING_RESISTANT
#define ECC_TIMING_RESISTANT

#undef  WC_RSA_BLINDING
#define WC_RSA_BLINDING

#undef  HAVE_AESGCM
#define HAVE_AESGCM

#undef  WOLFSSL_SHA512
#define WOLFSSL_SHA512

#undef  WOLFSSL_SHA384
#define WOLFSSL_SHA384

#undef  NO_DSA
#define NO_DSA

#undef  HAVE_ECC
#define HAVE_ECC

#undef  TFM_ECC256
#define TFM_ECC256

#undef  WOLFSSL_BASE64_ENCODE
#define WOLFSSL_BASE64_ENCODE

#undef  NO_RC4
#define NO_RC4

#undef  WOLFSSL_SHA224
#define WOLFSSL_SHA224

#undef  WOLFSSL_SHA3
#define WOLFSSL_SHA3

#undef  HAVE_POLY1305
#define HAVE_POLY1305

#undef  HAVE_ONE_TIME_AUTH
#define HAVE_ONE_TIME_AUTH

#undef  HAVE_CHACHA
#define HAVE_CHACHA

#undef  HAVE_HASHDRBG
#define HAVE_HASHDRBG

#undef  NO_FILESYSTEM
#define NO_FILESYSTEM

#undef  HAVE_TLS_EXTENSIONS
#define HAVE_TLS_EXTENSIONS

#undef  HAVE_SUPPORTED_CURVES
#define HAVE_SUPPORTED_CURVES

#undef  HAVE_EXTENDED_MASTER
#define HAVE_EXTENDED_MASTER

#undef  NO_PSK
#define NO_PSK

#undef  NO_MD4
#define NO_MD4

#undef  NO_PWDBASED
#define NO_PWDBASED

#undef  USE_FAST_MATH
#define USE_FAST_MATH

#undef  WOLFSSL_NO_ASM
#define WOLFSSL_NO_ASM

#undef  WOLFSSL_X86_BUILD
#define WOLFSSL_X86_BUILD

#undef  WC_NO_ASYNC_THREADING
#define WC_NO_ASYNC_THREADING

#undef  NO_DES3
#define NO_DES3

#undef  WOLFSSL_STATIC_MEMORY
#define WOLFSSL_STATIC_MEMORY

#undef  WOLFSSL_TLS13
#define WOLFSSL_TLS13

#undef  HAVE_HKDF
#define HAVE_HKDF

#undef  WC_RSA_PSS
#define WC_RSA_PSS

#undef  HAVE_FFDHE_2048
#define HAVE_FFDHE_2048


#if 0
#undef  WOLFSSL_HAVE_SP_RSA
#define WOLFSSL_HAVE_SP_RSA
#undef  WOLFSSL_HAVE_SP_DH
#define WOLFSSL_HAVE_SP_DH
#undef  WOLFSSL_HAVE_SP_ECC
#define WOLFSSL_HAVE_SP_ECC
#endif

#if defined(CONFIG_WOLFSSL_DEBUG)
#undef  DEBUG_WOLFSSL
#define DEBUG_WOLFSSL
#endif


what could be wrong?

Best Regards

Share

Re: Wolfssl_test build error

Hi,

Please enable wolfSSL debug logging by defining CONFIG_WOLFSSL_DEBUG/DEBUG_WOLFSSL and attach a debug log here.
Please also attach the cert you are trying to register.
If this is sensitive information, please contact us at support [AT] wolfssl [dot] com.

Share

Re: Wolfssl_test build error

Hi,
    Please find the debug log and the cert.

Post's attachments

wolfssl_test_data.zip 3.1 kb, 2 downloads since 2023-01-12 

You don't have the permssions to download the attachments of this post.

Share

Re: Wolfssl_test build error

Our date check is failing: Date BEFORE check failed
This normally happens when your system time (RTC) is not set correctly, are you confident this is set correctly on your system?
Note that, on Zephyr we use clock_gettime with a clock ID of CLOCK_REALTIME.  I would confirm this is returning the correct time for you.  See z_time in wolfcrypt/src/wc_port.c.

Share