From f59fb0df8eae09b8f4cefb34bfa96548062738c4 Mon Sep 17 00:00:00 2001 From: Chris Conlon Date: Fri, 7 Apr 2017 14:10:28 -0600 Subject: [PATCH] add custom print to test.c for PB --- wolfcrypt/test/test.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/wolfcrypt/test/test.c b/wolfcrypt/test/test.c index fbe4e290e..97eb5e56a 100644 --- a/wolfcrypt/test/test.c +++ b/wolfcrypt/test/test.c @@ -201,6 +201,11 @@ void BSP_Ser_Printf (CPU_CHAR* format, ...); #undef printf #define printf BSP_Ser_Printf +#elif defined(WOLFSSL_PB) + #include + int wolfssl_pb_print(const char*, ...); + #undef printf + #define printf wolfssl_pb_print #endif #include "wolfcrypt/test/test.h" @@ -400,6 +405,23 @@ static void myFipsCb(int ok, int err, const char* hash) #endif #endif +#ifdef WOLFSSL_PB +int wolfssl_pb_print(const char* msg, ...) +{ + int ret; + va_list args; + char tmpBuf[80]; + + va_start(args, msg); + ret = vsprint(tmpBuf, msg, args); + va_end(args); + + fnDumpStringToSystemLog(tmpBuf); + + return ret; +} +#endif /* WOLFSSL_PB */ + #ifdef HAVE_STACK_SIZE THREAD_RETURN WOLFSSL_THREAD wolfcrypt_test(void* args) #else