Skip to content

Commit 04d276d

Browse files
committed
Detect if WOLFSSL_MAX_ERROR_SZ is too small
1 parent e763dcc commit 04d276d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

wolfcrypt/test/test.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2889,6 +2889,11 @@ WOLFSSL_TEST_SUBROUTINE wc_test_ret_t error_test(void)
28892889
{ WC_SPAN1_LAST_E - 1, WC_SPAN2_FIRST_E + 1 },
28902890
{ WC_SPAN2_LAST_E - 1, WC_SPAN2_MIN_CODE_E }
28912891
};
2892+
#if defined(WOLFSSL_MAX_ERROR_SZ) && (WOLFSSL_MAX_ERROR_SZ < 64)
2893+
/* If too small, the error_test() will fail.
2894+
* See fixed length strings returned in wc_GetErrorString() */
2895+
WOLFSSL_MSG("WOLFSSL_MAX_ERROR_SZ is too small");
2896+
#endif
28922897

28932898
/* Check that all errors have a string and it's the same through the two
28942899
* APIs. Check that the values that are not errors map to the unknown

0 commit comments

Comments
 (0)