0
0
mirror of https://github.com/OpenVPN/openvpn3.git synced 2024-09-20 20:13:05 +02:00

Fix build issues against OpenSSL 1.0.x

The two prior changes broke OpenSSL 1.0.x support, due to the
SSL_R_CA_MD_TOO_WEAK and SSL_R_CA_KEY_TOO_SMALL error codes arrived
first in OpenSSL 1.1.0

Signed-off-by: David Sommerseth <davids@openvpn.net>
This commit is contained in:
David Sommerseth 2020-03-03 15:53:48 +01:00
parent 65a5e959bc
commit 44e8dd8c01
No known key found for this signature in database
GPG Key ID: 86CF944C9671FDF2

View File

@ -144,12 +144,15 @@ namespace openvpn {
case SSL_R_UNSUPPORTED_PROTOCOL:
set_code(Error::TLS_VERSION_MIN, true);
break;
#if OPENSSL_VERSION_NUMBER >= 0x10100000L
// These error codes are not available in older OpenSSL versions
case SSL_R_CA_MD_TOO_WEAK:
set_code(Error::SSL_CA_MD_TOO_WEAK, true);
break;
case SSL_R_CA_KEY_TOO_SMALL:
set_code(Error::SSL_CA_KEY_TOO_SMALL, true);
break;
#endif // OpenSSL >= 1.1.0
case SSL_R_DH_KEY_TOO_SMALL:
set_code(Error::SSL_DH_KEY_TOO_SMALL, true);
break;