Skip to content

Commit 436e65a

Browse files
committed
Use BIO_read_ex only with OpenSSL >= 1.1.1
1 parent c762aac commit 436e65a

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

winpr/tools/makecert/makecert.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,13 @@ static char* makecert_read_str(BIO* bio, size_t* pOffset)
100100

101101
length = new_len;
102102
x509_str = new_str;
103+
#if OPENSSL_VERSION_NUMBER >= 0x10101000L
103104
status = BIO_read_ex(bio, &x509_str[offset], length - offset, &readBytes);
104-
105-
if (status < 0)
105+
#else
106+
status = BIO_read(bio, &x509_str[offset], length - offset);
107+
readBytes = status;
108+
#endif
109+
if (status <= 0)
106110
break;
107111

108112
offset += (size_t)readBytes;

0 commit comments

Comments
 (0)