-
Notifications
You must be signed in to change notification settings - Fork 736
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IoTHubDeviceClient_CreateFromDeviceAuth() using symmetric key attestation issue #2612
Comments
Hey @mulligan252 , I just revisited the provisioning_client/samples/prov_dev_client_ll_sample to make sure everything was working as it should, and it worked with no issues. No custom hsm necessary. Here is my output:
Note that in sample
In that last line (when it calls prov_dev_set_symmetric_key_info), you must create a derived symmetric key for your device out of the enrollment group symmetric key, as described in this guide: https://learn.microsoft.com/en-us/azure/iot-dps/concepts-symmetric-key-attestation?tabs=azure-cli#group-enrollments It literally says to:
The result should be something like: "chfrq9t+YzF6/K/oYMW5Ii6m5dxmZDMVR3OyM8fI7jE=" Then fill these info in the prov_dev_client_ll_sample as shown in the diff above (using your own registration ID and derived key). |
Hi @mulligan252 , |
I am using the Azure IoT C SDK on Debian. I provision devices on my IoT Hub via a symmetric key enrolment group from my code. Provisioning works fine and I can see my devices on the hub.
The problem I have is that I can't create a device handle for any device in my code using the function IoTHubDeviceClient_CreateFromDeviceAuth(). From studying the documentation, my code must be linked against the library built from the custom_hsm_example.
I've modified the custom_hsm_example as follows, removing any certificate-related stuff. For the SYMMETRIC_KEY, i'm putting the symmetric primary key copied from the portal, and REGISTRATION_NAME is the name of my enrolment group ( i'm not sure if this is correct ? ) :
On calling
IoTHubDeviceClient_CreateFromDeviceAuth("test-hub.azure-devices.net", "test-device", protocol)
from my application, I get the following failure as below. The provisioning is successful, but fails on creating the device handle. Would anyone be able to assist with solving this?The text was updated successfully, but these errors were encountered: