Microsoft Azure IoTHub client libraries
Dependents: sht15_remote_monitoring RobotArmDemo iothub_client_sample_amqp f767zi_mqtt ... more
This library implements the Microsoft Azure IoTHub client library. The code is replicated from https://github.com/Azure/azure-iot-sdks
Diff: iothub_client_authorization.c
- Revision:
- 76:943524fee0b7
- Parent:
- 75:86205ca63a59
- Child:
- 78:74a8d3068204
--- a/iothub_client_authorization.c Mon Sep 11 09:22:55 2017 -0700 +++ b/iothub_client_authorization.c Mon Sep 25 13:37:53 2017 -0700 @@ -290,7 +290,7 @@ return result; } -char* IoTHubClient_Auth_Get_SasToken(IOTHUB_AUTHORIZATION_HANDLE handle, const char* scope, size_t expire_time) +char* IoTHubClient_Auth_Get_SasToken(IOTHUB_AUTHORIZATION_HANDLE handle, const char* scope, size_t expiry_time_relative_seconds) { char* result; /* Codes_SRS_IoTHub_Authorization_07_009: [ if handle or scope are NULL, IoTHubClient_Auth_Get_SasToken shall return NULL. ] */ @@ -314,7 +314,7 @@ } else { - size_t expiry_time = sec_since_epoch+expire_time; + size_t expiry_time = sec_since_epoch+expiry_time_relative_seconds; dev_auth_cred.sas_info.expiry_seconds = expiry_time; dev_auth_cred.sas_info.token_scope = scope; dev_auth_cred.dev_auth_type = AUTH_TYPE_SAS; @@ -372,7 +372,7 @@ STRING_HANDLE sas_token; size_t sec_since_epoch; - /* Codes_SRS_IoTHub_Authorization_07_010: [ IoTHubClient_Auth_Get_ConnString shall construct the expiration time using the expire_time. ] */ + /* Codes_SRS_IoTHub_Authorization_07_010: [ IoTHubClient_Auth_Get_SasToken` shall construct the expiration time using the expiry_time_relative_seconds added to epoch time. ] */ if (get_seconds_since_epoch(&sec_since_epoch) != 0) { /* Codes_SRS_IoTHub_Authorization_07_020: [ If any error is encountered IoTHubClient_Auth_Get_ConnString shall return NULL. ] */ @@ -382,7 +382,7 @@ else { /* Codes_SRS_IoTHub_Authorization_07_011: [ IoTHubClient_Auth_Get_ConnString shall call SASToken_CreateString to construct the sas token. ] */ - size_t expiry_time = sec_since_epoch+expire_time; + size_t expiry_time = sec_since_epoch+expiry_time_relative_seconds; if ( (sas_token = SASToken_CreateString(handle->device_key, scope, key_name, expiry_time)) == NULL) { /* Codes_SRS_IoTHub_Authorization_07_020: [ If any error is encountered IoTHubClient_Auth_Get_ConnString shall return NULL. ] */