diff options
author | Pete Bentley <prb@google.com> | 2022-05-13 21:57:28 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2022-05-13 21:57:28 +0000 |
commit | 6dd9394ac7a1561ed622524baac4294b2634cd5e (patch) | |
tree | dab6e1dafcbcb1efe9b7fe5c6db822158a35b8e9 | |
parent | 8ed20445521432f8bd3359c39a9ef01c8b05218d (diff) | |
parent | df1a1e826f54c950c475c487498d78a3888a5f5a (diff) | |
download | boringssl-6dd9394ac7a1561ed622524baac4294b2634cd5e.tar.gz |
Explicitly call BORINGSSL_self_test() in boringssl_self_test. am: df1a1e826f
Original change: https://googleplex-android-review.googlesource.com/c/platform/external/boringssl/+/18375513
Change-Id: Idaa386892438feb2bbff905c8248cdcbae755910
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r-- | selftest/boringssl_self_test.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/selftest/boringssl_self_test.cpp b/selftest/boringssl_self_test.cpp index 3d2d5209..4776fa1d 100644 --- a/selftest/boringssl_self_test.cpp +++ b/selftest/boringssl_self_test.cpp @@ -16,12 +16,16 @@ #include <openssl/crypto.h> +// This program is run early during boot and if it exits with a +// failure status then the device will reboot to the bootloader. +// See init.rc for details. +// It may also exit before reaching main() if BoringSSL fast tests fail. int main(int, char**) { - // If we get here, then libcrypto is either in FIPS mode (in which case - // it doesn't run the self test), or the self test has passed. If the - // self test ran and failed, then libcrypto will already have abort()ed. if (!FIPS_mode()) { - return 1; // failure + return 1; // Fail: BoringSSL not built in FIPS mode. } - return 0; // success + if (!BORINGSSL_self_test()) { + return 1; // Fail: One or more self tests failed. + } + return 0; // Success } |