-
Notifications
You must be signed in to change notification settings - Fork 31
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
SigV4_GenerateHTTPAuthorization unit tests #29
Merged
Merged
Changes from 1 commit
Commits
Show all changes
50 commits
Select commit
Hold shift + click to select a range
cc45898
Link OpenSSL to the test
yourslab 5d60836
Add unit tests attaining branch coverage of 71%
yourslab 9a688f5
Output authBufLen when complete
yourslab 6174e8d
Fix test case
yourslab fa4a976
Revert changes to sigv4 sources
yourslab 1e95193
SigV4_GenerateHTTPAuthorization Implementation
amazon-auto e1d370f
Merge doxygen
yourslab 5140fa6
Create SigV4ConstString_t type
yourslab 7cb9491
Fix checks
yourslab 43258d6
Hygiene improvements in URI encoding logic
aggarw13 bcd8e72
Hygiene improvements in Authorization Header prefix value logic
aggarw13 962a2f7
Minor improvements
aggarw13 ab889d5
Resolve compiler warning
yourslab 0a81e65
Fix checks
yourslab 613363d
Address review comments
aggarw13 2380cab
More comment changes
aggarw13 dea0cc9
Merge branch 'generate-auth-header' into sigv4-unit-tests
aggarw13 098f715
Fix build errors
aggarw13 999a91d
Fix unit test run failures
aggarw13 080469e
Merge remote-tracking branch 'origin/main' into sigv4-unit-tests
aggarw13 aebaf44
Add test case for sorting corner cases
aggarw13 412c972
Minor coverage increment and hygiene of redundant length check in lib…
aggarw13 d8d5c9a
Prune API to remove unused members of struct, and add test coverage f…
aggarw13 90addaf
More code coverage on logic of trimmable spaces & header count > thre…
aggarw13 5a107b4
Hygiene improvements in build configuration
aggarw13 eb051de
Small refactor in implementation and complete testing coverage of enc…
aggarw13 74aa6d7
Fix bugs in encodeURI implementation when handling special characters…
aggarw13 49a150f
Fix some CI checks
aggarw13 160a31c
Disable asserts from unit test coverage
aggarw13 32d2bf5
Fix some doxygen failures
aggarw13 c27dfec
Merge branch 'main' into sigv4-unit-tests
muneebahmed10 ebdc1d4
Merge remote-tracking branch 'origin/main' into sigv4-unit-tests
aggarw13 532fbad
Address minor review comments
aggarw13 4e725e7
Merge branch 'sigv4-unit-tests' of github.com:yourslab/SigV4-for-AWS-…
aggarw13 ea007d9
Add error code for invalid HTTP headers and increment test coverage
aggarw13 d6909ac
Hygiene improvement in sigv4.c and test coverage increment
aggarw13 5ef01b9
Minor hygiene refactor in implementation and test coverage for canoni…
aggarw13 7c070fe
Complete test coverage for canonical functions
aggarw13 644d961
Merge remote-tracking branch 'origin/main' into sigv4-unit-tests
aggarw13 2bc887c
Fix some CI check failures
aggarw13 d43b903
Make more hygiene improvements and increase test coverage
aggarw13 0db41aa
Achieve 100% coverage
aggarw13 b2bc43f
Hygiene improvements
aggarw13 5a12d8c
Minor README.md update
aggarw13 3eaad85
Merge remote-tracking branch 'origin/main' into sigv4-unit-tests
aggarw13 f8d62ee
Address review comments
aggarw13 26b26bd
Quicksort: Remove unnecessary branches of invalid array or elements a…
aggarw13 6c04aba
100% coverage again
aggarw13 faafb73
Apply suggestions from code review
aggarw13 a87b4f3
Fix complexity and hygiene improvements
aggarw13 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -147,8 +147,7 @@ static void quickSortHelper( void * pArray, | |
/* Calculate length of the left partition containing items smaller | ||
* than the pivot element. | ||
* The length is zero if either: | ||
* 1. The pivoted item is the smallest in the | ||
* the array before partitioning. | ||
* 1. The pivoted item is the smallest in the the array before partitioning. | ||
* OR | ||
* 2. The left partition is only of single length which can be treated as | ||
* sorted, and thus, of zero length for avoided adding to the stack. */ | ||
|
@@ -157,7 +156,7 @@ static void quickSortHelper( void * pArray, | |
/* Calculate length of the right partition containing items greater than | ||
* or equal to the pivot item. | ||
* The calculated length is zero if either: | ||
* 1. The pivoted item is the smallest in the the array before partitioning. | ||
* 1. The pivoted item is the greatest in the the array before partitioning. | ||
* OR | ||
* 2. The right partition contains only a single length which can be treated as | ||
* sorted, and thereby, of zero length to avoid adding to the stack. */ | ||
|
@@ -202,31 +201,32 @@ static size_t partition( void * pArray, | |
size_t itemSize, | ||
ComparisonFunc_t comparator ) | ||
{ | ||
void * pivot; | ||
uint8_t * pivot; | ||
uint8_t * pArrayLocal = ( uint8_t * ) pArray; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This addresses the warnings generated (by
|
||
size_t i = low - 1U, j = low; | ||
|
||
assert( pArray != NULL ); | ||
assert( comparator != NULL ); | ||
|
||
/* Choose pivot as the highest indexed item in the current partition. */ | ||
pivot = pArray + ( high * itemSize ); | ||
pivot = pArrayLocal + ( high * itemSize ); | ||
|
||
/* Iterate over all elements of the current array to partition it | ||
* in comparison to the chosen pivot with smaller items on the left | ||
* and larger or equal to items on the right. */ | ||
for( ; j < high; j++ ) | ||
{ | ||
/* Use comparator function to check current element is smaller than the pivot */ | ||
if( comparator( pArray + ( j * itemSize ), pivot ) < 0 ) | ||
if( comparator( pArrayLocal + ( j * itemSize ), pivot ) < 0 ) | ||
{ | ||
++i; | ||
swap( pArray + ( i * itemSize ), pArray + ( j * itemSize ), itemSize ); | ||
swap( pArrayLocal + ( i * itemSize ), pArrayLocal + ( j * itemSize ), itemSize ); | ||
} | ||
} | ||
|
||
/* Place the pivot between the smaller and larger item chunks of | ||
* the array. This represents the 2 partitions of the array. */ | ||
swap( pArray + ( ( i + 1U ) * itemSize ), pivot, itemSize ); | ||
swap( pArrayLocal + ( ( i + 1U ) * itemSize ), pivot, itemSize ); | ||
|
||
/* Return the pivot item's index. */ | ||
return i + 1U; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why assert this? That may certainly not be the case depending on how the hash functions are implemented.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding the prefix does not involve hashing operations but only involves adding the prefix string to the cache. Thus, I added the assert.