Fix `use_identity_as_username true` not working.

Closes #833.

Thanks to David Crook and Brice Waegeneire.

Bug: https://github.com/eclipse/mosquitto/issues/833

Signed-off-by: Roger A. Light <roger@atchoo.org>
pull/891/head
Roger A. Light 7 years ago
parent 2a3305a4a2
commit 0d25cb58b4

@ -20,6 +20,7 @@ Broker:
#209.
- Fix bridge publishing failing when per_listener_settings was true. Closes
#860.
- Fix `use_identity_as_username true` not working. Closes #833.
Library:
- Fix some places where return codes were incorrect, including to the

@ -455,6 +455,11 @@ int handle__connect(struct mosquitto_db *db, struct mosquitto *context)
goto handle_connect_error;
}
context->username = mosquitto__strdup((char *) ASN1_STRING_data(name_asn1));
if(!context->username){
send__connack(context, 0, CONNACK_REFUSED_SERVER_UNAVAILABLE);
rc = MOSQ_ERR_NOMEM;
goto handle_connect_error;
}
/* Make sure there isn't an embedded NUL character in the CN */
if ((size_t)ASN1_STRING_length(name_asn1) != strlen(context->username)) {
send__connack(context, 0, CONNACK_REFUSED_BAD_USERNAME_PASSWORD);

Loading…
Cancel
Save