Merge pull request #4141 from kaleb-himes/FIPS_ANDROID_v454

Changes to support Android app with wolfCrypt module v4.5.4
This commit is contained in:
Chris Conlon
2021-07-21 11:23:42 -06:00
committed by GitHub
2 changed files with 12 additions and 3 deletions

View File

@ -110,7 +110,10 @@
#undef NO_FILESYSTEM
#define NO_FILESYSTEM
#elif defined(ANDROID)
/* ANDROID_V454 (for android studio) displays information in a textview
* and redirects printf to the textview output instead of using
* __android_log_print() */
#elif defined(ANDROID) && !defined(ANDROID_V454)
#ifdef XMALLOC_USER
#include <stdlib.h> /* we're using malloc / free direct here */
#endif

View File

@ -172,10 +172,16 @@ _Pragma("GCC diagnostic ignored \"-Wunused-function\"")
#endif
#include <android/log.h>
#define printf(...) \
#ifdef ANDROID_V454 /* See fips/android/wolfCrypt_v454_android */
#ifndef NO_FILESYSTEM
#define NO_FILESYSTEM /* Turn off tests that want to call SaveDerAndPem() */
#endif
#else
#define printf(...) \
__android_log_print(ANDROID_LOG_DEBUG, "TAG", __VA_ARGS__)
#define fprintf(fp, ...) \
#define fprintf(fp, ...) \
__android_log_print(ANDROID_LOG_DEBUG, "TAG", __VA_ARGS__)
#endif
#elif defined(WOLFSSL_DEOS)
#include <printx.h>
#undef printf