Skip to content

Commit

Permalink
Merge branch 'develop' into iot-credentials-producer-c
Browse files Browse the repository at this point in the history
  • Loading branch information
disa6302 authored Dec 6, 2023
2 parents e3a7419 + 94b9b0c commit 4433e3c
Show file tree
Hide file tree
Showing 10 changed files with 145 additions and 37 deletions.
37 changes: 33 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ jobs:
id-token: write
contents: read
env:
CC: gcc
CXX: g++
CC: /usr/local/bin/gcc-13
CXX: /usr/local/bin/g++-13
AWS_KVS_LOG_LEVEL: 2
steps:
- name: Clone repository
Expand Down Expand Up @@ -85,14 +85,43 @@ jobs:
cd build
./tst/producer_test
mac-os-m1-build-clang:
runs-on: macos-13-xlarge
env:
AWS_KVS_LOG_LEVEL: 2
permissions:
id-token: write
contents: read
steps:
- name: Clone repository
uses: actions/checkout@v3
- name: Build repository
run: |
brew install pkgconfig
brew unlink openssl # it seems the libcurl is trying to access this openssl despite explicitly setting it to our build
mkdir build && cd build
sh -c 'cmake .. -DBUILD_TEST=TRUE -DCOMPILER_WARNINGS=TRUE -DCMAKE_C_COMPILER=$(brew --prefix llvm@15)/bin/clang -DCMAKE_CXX_COMPILER=$(brew --prefix llvm@15)/bin/clang++;cmake .. -DBUILD_TEST=TRUE -DCOMPILER_WARNINGS=TRUE -DCMAKE_C_COMPILER=$(brew --prefix llvm@15)/bin/clang -DCMAKE_CXX_COMPILER=$(brew --prefix llvm@15)/bin/clang++'
make
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1-node16
with:
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
role-session-name: ${{ secrets.AWS_ROLE_SESSION_NAME }}
aws-region: ${{ secrets.AWS_REGION }}
role-duration-seconds: 10800
- name: Run tests
run: |
cd build
./tst/producer_test
mac-os-build-gcc-local-openssl:
runs-on: macos-11
permissions:
id-token: write
contents: read
env:
CC: gcc
CXX: g++
CC: /usr/local/bin/gcc-13
CXX: /usr/local/bin/g++-13
AWS_KVS_LOG_LEVEL: 2
LDFLAGS: -L/usr/local/opt/openssl@3/lib
CPPFLAGS: -I/usr/local/opt/openssl@3/include
Expand Down
36 changes: 29 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMake;${CMAKE_MODULE_PATH}")
include(Utilities)
project(KinesisVideoProducerC VERSION 1.5.1 LANGUAGES C)

set(KINESIS_VIDEO_PRODUCER_C_MAJOR_VERSION 1)
set(KINESIS_VIDEO_PRODUCER_C_MINOR_VERSION 5)
set(KINESIS_VIDEO_PRODUCER_C_PATCH_VERSION 1)
set(KINESIS_VIDEO_PRODUCER_C_VERSION ${KINESIS_VIDEO_PRODUCER_C_MAJOR_VERSION}.${KINESIS_VIDEO_PRODUCER_C_MINOR_VERSION}.${KINESIS_VIDEO_PRODUCER_C_PATCH_VERSION})

include(GNUInstallDirs)


Expand All @@ -29,6 +34,11 @@ option(UNDEFINED_BEHAVIOR_SANITIZER "Build with UndefinedBehaviorSanitizer." OFF
option(ALIGNED_MEMORY_MODEL "Aligned memory model ONLY." OFF)
option(SET_SSL_CALLBACKS "Set SSL thread and lock callbacks." OFF)

set(TYPE_OF_LIB SHARED)
if (BUILD_STATIC)
set(TYPE_OF_LIB STATIC)
endif()

set(CMAKE_MACOSX_RPATH TRUE)

get_filename_component(ROOT "${CMAKE_CURRENT_SOURCE_DIR}" ABSOLUTE)
Expand Down Expand Up @@ -262,8 +272,15 @@ if(BUILD_COMMON_LWS)
"${CMAKE_CURRENT_SOURCE_DIR}/libkvsCommonLws.pc.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/libkvsCommonLws.pc" @ONLY)

add_library(kvsCommonLws STATIC ${KVS_COMMON_SOURCE_FILES_BASE} ${KVS_COMMON_SOURCE_FILES_LWS})
if (WIN32)
add_library(kvsCommonLws STATIC ${KVS_COMMON_SOURCE_FILES_BASE} ${KVS_COMMON_SOURCE_FILES_LWS})
else()
add_library(kvsCommonLws ${TYPE_OF_LIB} ${KVS_COMMON_SOURCE_FILES_BASE} ${KVS_COMMON_SOURCE_FILES_LWS})
endif()
target_compile_definitions(kvsCommonLws PRIVATE KVS_BUILD_WITH_LWS ${CPRODUCER_COMMON_TLS_OPTION})
if(NOT BUILD_STATIC)
set_target_properties(kvsCommonLws PROPERTIES VERSION ${KINESIS_VIDEO_PRODUCER_C_VERSION} SOVERSION ${KINESIS_VIDEO_PRODUCER_C_MAJOR_VERSION})
endif()
target_link_libraries(kvsCommonLws
${OPENSSL_CRYPTO_LIBRARY}
${OPENSSL_SSL_LIBRARY}
Expand Down Expand Up @@ -295,8 +312,15 @@ if(BUILD_COMMON_CURL)
endif()
endif()

add_library(kvsCommonCurl STATIC ${KVS_COMMON_SOURCE_FILES_BASE} ${KVS_COMMON_SOURCE_FILES_CURL})
if (WIN32)
add_library(kvsCommonCurl STATIC ${KVS_COMMON_SOURCE_FILES_BASE} ${KVS_COMMON_SOURCE_FILES_CURL})
else()
add_library(kvsCommonCurl ${TYPE_OF_LIB} ${KVS_COMMON_SOURCE_FILES_BASE} ${KVS_COMMON_SOURCE_FILES_CURL})
endif()
target_compile_definitions(kvsCommonCurl PRIVATE KVS_BUILD_WITH_CURL ${CPRODUCER_COMMON_TLS_OPTION})
if(NOT BUILD_STATIC)
set_target_properties(kvsCommonCurl PROPERTIES VERSION ${KINESIS_VIDEO_PRODUCER_C_VERSION} SOVERSION ${KINESIS_VIDEO_PRODUCER_C_MAJOR_VERSION})
endif()
target_link_libraries(kvsCommonCurl
kvspicUtils
${CURL_LIBRARIES}
Expand All @@ -315,16 +339,14 @@ if(BUILD_COMMON_CURL)
"${CMAKE_CURRENT_SOURCE_DIR}/libcproducer.pc.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/libcproducer.pc" @ONLY)

set(TYPE_OF_LIB SHARED)
if (BUILD_STATIC)
set(TYPE_OF_LIB STATIC)
endif()

if (WIN32)
add_library(cproducer STATIC ${PRODUCER_C_SOURCE_FILES})
else()
add_library(cproducer ${TYPE_OF_LIB} ${PRODUCER_C_SOURCE_FILES})
endif()
if(NOT BUILD_STATIC)
set_target_properties(cproducer PROPERTIES VERSION ${KINESIS_VIDEO_PRODUCER_C_VERSION} SOVERSION ${KINESIS_VIDEO_PRODUCER_C_MAJOR_VERSION})
endif()
target_link_libraries(cproducer PUBLIC kvsCommonCurl kvspic)

install(
Expand Down
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,17 @@ To run the samples with IoT credential provider:
3. Build the changes: `make`
4. Run the sample using the instructions in previous section.

### Fragment metadata

`./kvsVideoOnlyRealtimeStreamingSample` is the only sample that has the [fragment metadata](https://docs.aws.amazon.com/kinesisvideostreams/latest/dg/how-meta.html) implemented out of the box.

In addition to the required arguments above, this sample has an additional argument:
```shell
./kvsVideoOnlyRealtimeStreamingSample <stream-name> <video-codec> <streaming-duration-in-seconds> <sample-location> <num-metadata>
```

`num-metadata` -- the number of sample fragment metadata key-value pairs that are added to each fragment. Min: 0, Max: 10. Default: 10.

### Setting log levels


Expand Down
2 changes: 1 addition & 1 deletion libcproducer.pc.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ libdir=${exec_prefix}/@CMAKE_INSTALL_LIBDIR@

Name: KVS-libcproducer
Description: KVS C Producer library
Version: 0.0.0
Version: @KINESIS_VIDEO_PRODUCER_C_VERSION@
Cflags: -I${includedir}
Libs: -L${libdir} -lcproducer
2 changes: 1 addition & 1 deletion libkvsCommonCurl.pc.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ libdir=${exec_prefix}/@CMAKE_INSTALL_LIBDIR@

Name: KVS-libkvsCommonCurl
Description: KVS C Producer common curl library
Version: 0.0.0
Version: @KINESIS_VIDEO_PRODUCER_C_VERSION@
Cflags: -I${includedir}
Libs: -L${libdir} -lkvsCommonCurl
2 changes: 1 addition & 1 deletion libkvsCommonLws.pc.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ libdir=${exec_prefix}/@CMAKE_INSTALL_LIBDIR@

Name: KVS-libkvsCommonLws
Description: KVS C Producer common libwebsockets library
Version: 0.0.0
Version: @KINESIS_VIDEO_PRODUCER_C_VERSION@
Cflags: -I${includedir}
Libs: -L${libdir} -lkvsCommonLws
46 changes: 33 additions & 13 deletions samples/KvsVideoOnlyRealtimeStreamingSample.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
#define VIDEO_CODEC_NAME_H264 "h264"
#define VIDEO_CODEC_NAME_H265 "h265"
#define VIDEO_CODEC_NAME_MAX_LENGTH 5
#define METADATA_MAX_KEY_LENGTH 128
#define METADATA_MAX_VALUE_LENGTH 256
#define MAX_METADATA_PER_FRAGMENT 10

#define NUMBER_OF_FRAME_FILES 403

Expand Down Expand Up @@ -57,10 +60,10 @@ INT32 main(INT32 argc, CHAR* argv[])
STREAM_HANDLE streamHandle = INVALID_STREAM_HANDLE_VALUE;
STATUS retStatus = STATUS_SUCCESS;
PCHAR accessKey = NULL, secretKey = NULL, sessionToken = NULL, streamName = NULL, region = NULL, cacertPath = NULL;
CHAR frameFilePath[MAX_PATH_LEN + 1];
CHAR frameFilePath[MAX_PATH_LEN + 1], metadataKey[METADATA_MAX_KEY_LENGTH + 1], metadataValue[METADATA_MAX_VALUE_LENGTH + 1];
Frame frame;
BYTE frameBuffer[200000]; // Assuming this is enough
UINT32 frameSize = SIZEOF(frameBuffer), frameIndex = 0, fileIndex = 0;
UINT32 frameSize = SIZEOF(frameBuffer), frameIndex = 0, fileIndex = 0, n = 0, numMetadata = 10;
UINT64 streamStopTime, streamingDuration = DEFAULT_STREAM_DURATION;
DOUBLE startUpLatency;
BOOL firstFrame = TRUE;
Expand All @@ -79,8 +82,8 @@ INT32 main(INT32 argc, CHAR* argv[])
CHK_ERR((pIotCoreThingName = getenv(IOT_CORE_THING_NAME)) != NULL, STATUS_INVALID_OPERATION, "AWS_IOT_CORE_THING_NAME must be set");
#else
if (argc < 2) {
DLOGE("Usage: AWS_ACCESS_KEY_ID=SAMPLEKEY AWS_SECRET_ACCESS_KEY=SAMPLESECRET %s <stream_name> <codec> <duration_in_seconds> "
"<frame_files_path>\n",
DLOGE("Usage: AWS_ACCESS_KEY_ID=SAMPLEKEY AWS_SECRET_ACCESS_KEY=SAMPLESECRET %s <stream_name>"
"<codec> <duration_in_seconds> <frame_files_path> [num_metadata = 10]\n",
argv[0]);
CHK(FALSE, STATUS_INVALID_ARG);
}
Expand All @@ -91,13 +94,6 @@ INT32 main(INT32 argc, CHAR* argv[])
sessionToken = getenv(SESSION_TOKEN_ENV_VAR);
#endif

MEMSET(frameFilePath, 0x00, MAX_PATH_LEN + 1);
if (argc < 5) {
STRCPY(frameFilePath, (PCHAR) "../samples/");
} else {
STRNCPY(frameFilePath, argv[4], MAX_PATH_LEN);
}

cacertPath = getenv(CACERT_PATH_ENV_VAR);
#ifdef IOT_CORE_ENABLE_CREDENTIALS
streamName = pIotCoreThingName;
Expand All @@ -108,19 +104,32 @@ INT32 main(INT32 argc, CHAR* argv[])
region = (PCHAR) DEFAULT_AWS_REGION;
}

if (argc >= 3) {
if (argc >= 3 && !IS_EMPTY_STRING(argv[2])) {
if (!STRCMP(argv[2], VIDEO_CODEC_NAME_H265)) {
STRNCPY(videoCodec, VIDEO_CODEC_NAME_H265, STRLEN(VIDEO_CODEC_NAME_H265));
videoCodecID = VIDEO_CODEC_ID_H265;
}
}

if (argc >= 4) {
if (argc >= 4 && !IS_EMPTY_STRING(argv[3])) {
// Get the duration and convert to an integer
CHK_STATUS(STRTOUI64(argv[3], NULL, 10, &streamingDuration));
streamingDuration *= HUNDREDS_OF_NANOS_IN_A_SECOND;
}

MEMSET(frameFilePath, 0x00, MAX_PATH_LEN + 1);
if (argc >= 5 && !IS_EMPTY_STRING(argv[4])) {
STRNCPY(frameFilePath, argv[4], MAX_PATH_LEN);
} else {
STRCPY(frameFilePath, (PCHAR) "../samples/");
}

if (argc >= 6 && !IS_EMPTY_STRING(argv[5])) {
numMetadata = STRTOUL(argv[5], NULL, 10);
DLOGD("numMetadata: %d\n", numMetadata);
CHK(numMetadata <= MAX_METADATA_PER_FRAGMENT, STATUS_INVALID_ARG);
}

streamStopTime = GETTIME() + streamingDuration;

// default storage size is 128MB. Use setDeviceInfoStorageSize after create to change storage size.
Expand Down Expand Up @@ -173,6 +182,17 @@ INT32 main(INT32 argc, CHAR* argv[])

CHK_STATUS(readFrameData(&frame, frameFilePath, videoCodec));

// Add the fragment metadata key-value pairs
// For limits, refer to https://docs.aws.amazon.com/kinesisvideostreams/latest/dg/limits.html#limits-streaming-metadata
if (numMetadata > 0 && frame.flags == FRAME_FLAG_KEY_FRAME) {
DLOGD("Adding metadata! frameIndex: %d", frame.index);
for (n = 1; n <= numMetadata; n++) {
SNPRINTF(metadataKey, METADATA_MAX_KEY_LENGTH, "TEST_KEY_%d", n);
SNPRINTF(metadataValue, METADATA_MAX_VALUE_LENGTH, "TEST_VALUE_%d", frame.index + n);
CHK_STATUS(putKinesisVideoFragmentMetadata(streamHandle, metadataKey, metadataValue, TRUE));
}
}

CHK_STATUS(putKinesisVideoFrame(streamHandle, &frame));
if (firstFrame) {
startUpLatency = (DOUBLE) (GETTIME() - startTime) / (DOUBLE) HUNDREDS_OF_NANOS_IN_A_MILLISECOND;
Expand Down
6 changes: 6 additions & 0 deletions src/include/com/amazonaws/kinesis/video/common/Include.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,11 @@ extern "C" {
*/
#define MAX_REGION_NAME_LEN 128

/**
* Maximum allowed service name length
*/
#define MAX_SERVICE_NAME_LEN 128

/**
* Maximum allowed user agent string length
*/
Expand Down Expand Up @@ -483,6 +488,7 @@ struct __RequestInfo {
//!< NOTE: The body will follow the main struct
UINT32 bodySize; //!< Size of the body in bytes
CHAR url[MAX_URI_CHAR_LEN + 1]; //!< The URL for the request
CHAR service[MAX_SERVICE_NAME_LEN + 1]; //!< The AWS service for the request
CHAR certPath[MAX_PATH_LEN + 1]; //!< CA Certificate path to use - optional
CHAR sslCertPath[MAX_PATH_LEN + 1]; //!< SSL Certificate file path to use - optional
CHAR sslPrivateKeyPath[MAX_PATH_LEN + 1]; //!< SSL Certificate private key file path to use - optional
Expand Down
34 changes: 26 additions & 8 deletions src/source/Common/AwsV4Signer.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ STATUS generateAwsSigV4Signature(PRequestInfo pRequestInfo, PCHAR dateTimeStr, B
hmacSize = SIZEOF(hmac);
CHK_STATUS(generateRequestHmac((PBYTE) pScratchBuf, curSize, (PBYTE) dateTimeStr, SIGNATURE_DATE_STRING_LEN * SIZEOF(CHAR), hmac, &hmacSize));
CHK_STATUS(generateRequestHmac(hmac, hmacSize, (PBYTE) pRequestInfo->region, (UINT32) STRLEN(pRequestInfo->region), hmac, &hmacSize));
CHK_STATUS(generateRequestHmac(hmac, hmacSize, (PBYTE) KINESIS_VIDEO_SERVICE_NAME, (UINT32) STRLEN(KINESIS_VIDEO_SERVICE_NAME), hmac, &hmacSize));
CHK_STATUS(generateRequestHmac(hmac, hmacSize, (PBYTE) pRequestInfo->service, (UINT32) STRNLEN(pRequestInfo->service, MAX_SERVICE_NAME_LEN), hmac,
&hmacSize));
CHK_STATUS(generateRequestHmac(hmac, hmacSize, (PBYTE) AWS_SIG_V4_SIGNATURE_END, (UINT32) STRLEN(AWS_SIG_V4_SIGNATURE_END), hmac, &hmacSize));
CHK_STATUS(generateRequestHmac(hmac, hmacSize, (PBYTE) pSignedStr, signedStrLen * SIZEOF(CHAR), hmac, &hmacSize));

Expand Down Expand Up @@ -117,6 +118,12 @@ STATUS signAwsRequestInfo(PRequestInfo pRequestInfo)

CHK(pRequestInfo != NULL && pRequestInfo->pAwsCredentials != NULL, STATUS_NULL_ARG);

// signAwsRequestInfo is a public api function, if service is not specified default to "kinesisvideo" so no breaking changes are introduced to the
// api
if (pRequestInfo->service[0] == L'\0') {
STRNCPY(pRequestInfo->service, KINESIS_VIDEO_SERVICE_NAME, MAX_SERVICE_NAME_LEN);
}

// Generate the time
CHK_STATUS(generateSignatureDateTime(pRequestInfo->currentTime, dateTimeStr));

Expand Down Expand Up @@ -167,6 +174,12 @@ STATUS signAwsRequestInfoQueryParam(PRequestInfo pRequestInfo)

CHK(pRequestInfo != NULL && pRequestInfo->pAwsCredentials != NULL, STATUS_NULL_ARG);

// signAwsRequestInfoQueryParam is a public api function, if service is not specified default to "kinesisvideo" so no breaking changes are
// introduced to the api
if (pRequestInfo->service[0] == L'\0') {
STRNCPY(pRequestInfo->service, KINESIS_VIDEO_SERVICE_NAME, MAX_SERVICE_NAME_LEN);
}

// Generate the time
CHK_STATUS(generateSignatureDateTime(pRequestInfo->currentTime, dateTimeStr));

Expand Down Expand Up @@ -498,8 +511,13 @@ STATUS generateCanonicalRequestString(PRequestInfo pRequestInfo, PCHAR pRequestS
len = SHA256_DIGEST_LENGTH * 2;
CHK(curLen + len <= requestLen, STATUS_BUFFER_TOO_SMALL);
if (pRequestInfo->body == NULL) {
// Streaming treats this portion as if the body were empty
CHK_STATUS(hexEncodedSha256((PBYTE) EMPTY_STRING, 0, pCurPtr));
if (STRNCMP(pRequestInfo->service, KINESIS_VIDEO_SERVICE_NAME, MAX_SERVICE_NAME_LEN) == 0) {
// Streaming treats this portion as if the body were empty
CHK_STATUS(hexEncodedSha256((PBYTE) EMPTY_STRING, 0, pCurPtr));
} else {
len = (UINT32) (ARRAY_SIZE(PREDEFINED_UNSIGNED_PAYLOAD) - 1);
MEMCPY(pCurPtr, PREDEFINED_UNSIGNED_PAYLOAD, SIZEOF(CHAR) * len);
}
} else {
// standard signing
CHK_STATUS(hexEncodedSha256((PBYTE) pRequestInfo->body, pRequestInfo->bodySize, pCurPtr));
Expand Down Expand Up @@ -678,14 +696,14 @@ STATUS generateCredentialScope(PRequestInfo pRequestInfo, PCHAR dateTimeStr, PCH
CHK(pRequestInfo != NULL && dateTimeStr != NULL && pScopeLen != NULL, STATUS_NULL_ARG);

// Calculate the max string length with a null terminator at the end
scopeLen = SIGNATURE_DATE_TIME_STRING_LEN + 1 + MAX_REGION_NAME_LEN + 1 + (UINT32) STRLEN(KINESIS_VIDEO_SERVICE_NAME) + 1 +
scopeLen = SIGNATURE_DATE_TIME_STRING_LEN + 1 + MAX_REGION_NAME_LEN + 1 + (UINT32) STRNLEN(pRequestInfo->service, MAX_SERVICE_NAME_LEN) + 1 +
(UINT32) STRLEN(AWS_SIG_V4_SIGNATURE_END) + 1;

// Early exit on buffer calculation
CHK(pScope != NULL, retStatus);

scopeLen = (UINT32) SNPRINTF(pScope, *pScopeLen, CREDENTIAL_SCOPE_TEMPLATE, SIGNATURE_DATE_STRING_LEN, dateTimeStr, pRequestInfo->region,
KINESIS_VIDEO_SERVICE_NAME, AWS_SIG_V4_SIGNATURE_END);
pRequestInfo->service, AWS_SIG_V4_SIGNATURE_END);
CHK(scopeLen > 0 && scopeLen <= *pScopeLen, STATUS_BUFFER_TOO_SMALL);

CleanUp:
Expand All @@ -707,15 +725,15 @@ STATUS generateEncodedCredentials(PRequestInfo pRequestInfo, PCHAR dateTimeStr,
CHK(pRequestInfo != NULL && dateTimeStr != NULL && pCredsLen != NULL, STATUS_NULL_ARG);

// Calculate the max string length with '/' and a null terminator at the end
credsLen = MAX_ACCESS_KEY_LEN + 1 + SIGNATURE_DATE_TIME_STRING_LEN + 1 + MAX_REGION_NAME_LEN + 1 + (UINT32) STRLEN(KINESIS_VIDEO_SERVICE_NAME) +
1 + (UINT32) STRLEN(AWS_SIG_V4_SIGNATURE_END) + 1;
credsLen = MAX_ACCESS_KEY_LEN + 1 + SIGNATURE_DATE_TIME_STRING_LEN + 1 + MAX_REGION_NAME_LEN + 1 +
(UINT32) STRNLEN(pRequestInfo->service, MAX_SERVICE_NAME_LEN) + 1 + (UINT32) STRLEN(AWS_SIG_V4_SIGNATURE_END) + 1;

// Early exit on buffer calculation
CHK(pCreds != NULL, retStatus);

credsLen = (UINT32) SNPRINTF(pCreds, *pCredsLen, URL_ENCODED_CREDENTIAL_TEMPLATE, pRequestInfo->pAwsCredentials->accessKeyIdLen,
pRequestInfo->pAwsCredentials->accessKeyId, SIGNATURE_DATE_STRING_LEN, dateTimeStr, pRequestInfo->region,
KINESIS_VIDEO_SERVICE_NAME, AWS_SIG_V4_SIGNATURE_END);
pRequestInfo->service, AWS_SIG_V4_SIGNATURE_END);
CHK(credsLen > 0 && credsLen <= *pCredsLen, STATUS_BUFFER_TOO_SMALL);

CleanUp:
Expand Down
Loading

0 comments on commit 4433e3c

Please sign in to comment.