From 436e65acc99b80f49f517ea1db65e1592ecda8f8 Mon Sep 17 00:00:00 2001 From: akallabeth Date: Tue, 14 Sep 2021 07:28:09 +0200 Subject: [PATCH] Use BIO_read_ex only with OpenSSL >= 1.1.1 --- winpr/tools/makecert/makecert.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/winpr/tools/makecert/makecert.c b/winpr/tools/makecert/makecert.c index 165694849..77f8398a2 100644 --- a/winpr/tools/makecert/makecert.c +++ b/winpr/tools/makecert/makecert.c @@ -100,9 +100,13 @@ static char* makecert_read_str(BIO* bio, size_t* pOffset) length = new_len; x509_str = new_str; +#if OPENSSL_VERSION_NUMBER >= 0x10101000L status = BIO_read_ex(bio, &x509_str[offset], length - offset, &readBytes); - - if (status < 0) +#else + status = BIO_read(bio, &x509_str[offset], length - offset); + readBytes = status; +#endif + if (status <= 0) break; offset += (size_t)readBytes;