From 58e7d5388a6164138fecec77d004f12abde93dd4 Mon Sep 17 00:00:00 2001 From: Juliusz Sosinowicz Date: Mon, 17 May 2021 16:57:53 +0200 Subject: [PATCH] Check for XREAD when XFREAD fails On Windows we would always fail with `NOT_COMPILED_IN` when reading a file BIO. --- src/bio.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/bio.c b/src/bio.c index c82702e18..e54ebd833 100644 --- a/src/bio.c +++ b/src/bio.c @@ -230,15 +230,15 @@ int wolfSSL_BIO_read(WOLFSSL_BIO* bio, void* buf, int len) if (bio->ptr) { ret = (int)XFREAD(buf, 1, len, (XFILE)bio->ptr); } + else { #if !defined(USE_WINDOWS_API) && !defined(NO_WOLFSSL_DIR) && \ !defined(WOLFSSL_NUCLEUS) && !defined(WOLFSSL_NUCLEUS_1_2) - else { ret = (int)XREAD(bio->num, buf, len); - } #else - WOLFSSL_MSG("No file pointer and XREAD not enabled"); - ret = NOT_COMPILED_IN; + WOLFSSL_MSG("No file pointer and XREAD not enabled"); + ret = NOT_COMPILED_IN; #endif + } #else WOLFSSL_MSG("WOLFSSL_BIO_FILE used with NO_FILESYSTEM"); ret = NOT_COMPILED_IN;