From b59170fbd1878edf64109eae5ab8528b157cf88a Mon Sep 17 00:00:00 2001 From: Cody Miller Date: Thu, 6 Feb 2025 09:59:54 -0800 Subject: [PATCH] fix: compare result to CONNECTION_AUTHENTICATED This appears to be a theoretical bug. The sample code is comparing two values of disparate enum types. The enumerators that are being used in the comparison have the same values (and so the comparison behavior is valid), but other uses of this enumeration type suggest that this was a typo. --- .../samples/iothub_client_sample_hsm/iothub_client_sample_hsm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/provisioning_client/samples/iothub_client_sample_hsm/iothub_client_sample_hsm.c b/provisioning_client/samples/iothub_client_sample_hsm/iothub_client_sample_hsm.c index da3294c5e5..da191b8436 100644 --- a/provisioning_client/samples/iothub_client_sample_hsm/iothub_client_sample_hsm.c +++ b/provisioning_client/samples/iothub_client_sample_hsm/iothub_client_sample_hsm.c @@ -42,7 +42,7 @@ static void connection_status_callback(IOTHUB_CLIENT_CONNECTION_STATUS result, I IOTHUB_CLIENT_SAMPLE_INFO* iothub_info = (IOTHUB_CLIENT_SAMPLE_INFO*)user_context; if (iothub_info != NULL) { - if (reason == IOTHUB_CLIENT_CONNECTION_OK && result == IOTHUB_CLIENT_CONFIRMATION_OK) + if (reason == IOTHUB_CLIENT_CONNECTION_OK && result == IOTHUB_CLIENT_CONNECTION_AUTHENTICATED) { iothub_info->connected = 1; }