aws / aws-lc-rs

aws-lc-rs is a cryptographic library using AWS-LC for its cryptographic operations. The library strives to be API-compatible with the popular Rust library named ring.
Other
236 stars 40 forks source link

Auto-generated bindings for aws-lc-fips-sys v0.12.6 #372

Closed justsmth closed 3 months ago

justsmth commented 3 months ago

Description of changes:

Testing:

Bindings generated by this workflow run: https://github.com/aws/aws-lc-rs/actions/runs/8346539433

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 3 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 95.82%. Comparing base (2298ca8) to head (3e70628).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #372 +/- ## ======================================= Coverage 95.82% 95.82% ======================================= Files 60 60 Lines 7865 7865 ======================================= Hits 7537 7537 Misses 328 328 ```

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

Mark-Simulacrum commented 3 months ago

Defaults to dynamic build for FIPS (except for "musl" or when AWS_LC_FIPS_SYS_STATIC is set in environment).

Is there a reason for this documented somewhere? In general static builds are fairly idiomatic for Rust so this sounds surprising to me.

Instead of conditioning on musl I'd probably recommend crt-static target feature (see https://rust-lang.github.io/rfcs/1721-crt-static.html for some docs), that is probably more in line with matching libc linkage across lots of platforms. (Note that there's a long-standing ask from musl upstream that Rust stops statically linking by default, since that's not what you want on musl distros like Alpine).

justsmth commented 3 months ago

Is there a reason for this documented somewhere? In general static builds are fairly idiomatic for Rust so this sounds surprising to me.

There are a few reasons for this that are fairly specific to "FIPS":

Thus, we can perform the shared build of the FIPS modules across many more platforms than we can with static, and the shared build is less likely to be affected by LTO.

justsmth commented 3 months ago

To avoid potentially breaking downstream builds/deployment, the default build of aws-lc-fips-sys on Linux (x86-64 and aarch64) remains static in this PR.