Skip to content

Commit

Permalink
Revert "Update unit tests"
Browse files Browse the repository at this point in the history
This reverts commit b8ee13a.
  • Loading branch information
gshvang committed Aug 18, 2021
1 parent 489b6c2 commit bacabf1
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion test/unit-test/sigv4_utest.c
Original file line number Diff line number Diff line change
@@ -77,7 +77,7 @@
#define HEADERS "Host: iam.amazonaws.com\r\nContent-Type: application/x-www-form-urlencoded; charset=utf-8\r\nX-Amz-Date: "DATE "\r\n\r\n"
#define HEADERS_LENGTH ( sizeof( HEADERS ) - 1U )
#define PRECANON_HEADER "content-type:application/json;\nhost:iam.amazonaws.com\n"
#define HEADERS_WITH_X_AMZ_CONTENT_SHA256 "Host: iam.amazonaws.com\r\nContent-Type: application/x-www-form-urlencoded; charset=utf-8\r\nx-amz-content-sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b785\r\nX-Amz-Date: "DATE "\r\n\r\n"
#define HEADERS_WITH_X_AMZ_CONTENT_SHA256 "Host: iam.amazonaws.com\r\nContent-Type: application/x-www-form-urlencoded; charset=utf-8\r\nx-amz-content-sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b785\r\nX-Amz-Date: "DATE "\r\n\r\n"

/* Header data containing leading, trailing and sequential trimmable spaces. */
#define HEADERS_WITH_TRIMMABLE_SPACES " Header-1 : Value \t - \t 1 \r\n"
@@ -1292,3 +1292,12 @@ void test_SigV4_GenerateAuthorization_Headers_With_X_Amz_Content_Sha256_Header()
TEST_ASSERT_EQUAL( SigV4Success, SigV4_GenerateHTTPAuthorization(
&params, authBuf, &authBufLen, &signature, &signatureLen ) );
}

void test_SigV4_GenerateAuthorization_Headers_With_X_Amz_Content_Sha256_Header_Without_Flag()
{
params.pHttpParameters->pHeaders = HEADERS_WITH_X_AMZ_CONTENT_SHA256;
params.pHttpParameters->headersLen = strlen( HEADERS_WITH_X_AMZ_CONTENT_SHA256 );

TEST_ASSERT_EQUAL( SigV4Success, SigV4_GenerateHTTPAuthorization(
&params, authBuf, &authBufLen, &signature, &signatureLen ) );
}

0 comments on commit bacabf1

Please sign in to comment.