From 16835799b48a4d86d2b8eb9177ade680ac12bd27 Mon Sep 17 00:00:00 2001 From: Stephen Lombardo Date: Mon, 18 Nov 2019 11:19:04 -0500 Subject: [PATCH] log error for android through log API --- src/crypto_openssl.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/crypto_openssl.c b/src/crypto_openssl.c index 298255f..efc096c 100644 --- a/src/crypto_openssl.c +++ b/src/crypto_openssl.c @@ -113,8 +113,15 @@ static int sqlcipher_openssl_activate(void *ctx) { #ifdef SQLCIPHER_FIPS if(!FIPS_mode()){ if(!FIPS_mode_set(1)){ + unsigned long err = 0; ERR_load_crypto_strings(); +#ifdef __ANDROID__ + while((err = ERR_get_error()) != 0) { + __android_log_print(ANDROID_LOG_ERROR, "sqlcipher","error: %lx. %s.", err, ERR_error_string(err, NULL)); + } +#else ERR_print_errors_fp(stderr); +#endif } } #endif