Use BIO_read_ex only with OpenSSL >= 1.1.1

This commit is contained in:
akallabeth 2021-09-14 07:28:09 +02:00 committed by akallabeth
parent c762aacb3c
commit 436e65acc9
1 changed files with 6 additions and 2 deletions

View File

@ -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;