aws / aws-lc

AWS-LC is a general-purpose cryptographic library maintained by the AWS Cryptography team for AWS and their customers. It іs based on code from the Google BoringSSL project and the OpenSSL project.
Other
398 stars 118 forks source link

Avoid compiler warning #1981

Closed justsmth closed 1 week ago

justsmth commented 1 week ago

Issues:

Addresses aws/aws-lc-rs#574

Context

The compiler cannot always confirm that the array indices used are within the required bounds. On certain platform, specifically powerpc64le in this case, the compiler may generate a warning about it. For our build, warnings are treated as errors thus causing compilation to fail.

Description of changes:

Adds sanity checks to several locations in gcm.c that abort if the logic would reference an out-of-bounds index of an array.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and the ISC license.

codecov-commenter commented 1 week ago

Codecov Report

Attention: Patch coverage is 50.00000% with 3 lines in your changes missing coverage. Please review.

Project coverage is 78.77%. Comparing base (c9d48a6) to head (c64f830). Report is 15 commits behind head on main.

Files with missing lines Patch % Lines
crypto/fipsmodule/modes/gcm.c 50.00% 3 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1981 +/- ## ========================================== - Coverage 78.79% 78.77% -0.03% ========================================== Files 590 590 Lines 101506 101512 +6 Branches 14401 14403 +2 ========================================== - Hits 79979 79962 -17 - Misses 20891 20915 +24 + Partials 636 635 -1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.