src: ASN1_STRING_data is deprecated in OpenSSL 1.1

ASN1_STRING_get0_data replaces ASN1_STRING_data in OpenSSL 1.1 therefore
add an #ifdef for backwards compatibility.

Signed-off-by: Jelle van der Waa <jelle@vdwaa.nl>
pull/1077/head
Jelle van der Waa 7 years ago committed by Roger Light
parent 73c46174f8
commit 1a6f8d3c28

@ -457,7 +457,11 @@ int handle__connect(struct mosquitto_db *db, struct mosquitto *context)
rc = 1;
goto handle_connect_error;
}
#if OPENSSL_VERSION_NUMBER < 0x10100000L
context->username = mosquitto__strdup((char *) ASN1_STRING_data(name_asn1));
#else
context->username = mosquitto__strdup((char *) ASN1_STRING_get0_data(name_asn1));
#endif
if(!context->username){
send__connack(context, 0, CONNACK_REFUSED_SERVER_UNAVAILABLE);
rc = MOSQ_ERR_NOMEM;

Loading…
Cancel
Save