Detecting errors (i.e. fs-less platforms using fs-only APIs) at compile time is generally preferable to doing so at runtime, so https://boringssl-review.googlesource.com/c/boringssl/+/61726 opted to remove the APIs altogether on applicable targets. However, Trusty uses rust-openssl somewhere and rust-openssl binds a bunch of filesystem-dependent APIs unconditionally. To keep that working, switch to a stub fopen when OPENSSL_NO_FILESYSTEM is set. We effectively model a platform where the filesystem "exists", but is empty. Upstream OpenSSL similarly has OPENSSL_NO_STDIO still define the file BIO (unlike the socket BIO, which is excluded), but in a stub form. As part of this, I've gone ahead and resolved one of the Trusty TODOs. It does produce a duplicate symbol with [1], but things seem to link fine in treehugger. In case it does break, I've bumped BORINGSSL_API_VERSION, so we can go in and condition it if needed. [1] https://android.googlesource.com/trusty/lib/+/refs/heads/main/lib/openssl-stubs/bio.c Bug: 629 Change-Id: I4f20d872a7cde863d21c78090f270b77b03545fa Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/61925 Commit-Queue: Bob Beck <bbe@google.com> Auto-Submit: David Benjamin <davidben@google.com> Reviewed-by: Bob Beck <bbe@google.com>chromium-stable
parent
e9f816b12b
commit
0ffd3658dc
12 changed files with 11 additions and 50 deletions
Loading…
Reference in new issue