summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPete Bentley <prb@google.com>2022-05-13 21:20:15 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2022-05-13 21:20:15 +0000
commit78c1fb97622551ce548611ecb1cb39425bc5762f (patch)
treedab6e1dafcbcb1efe9b7fe5c6db822158a35b8e9
parenta77089d89027632ff43107f8ced5a09b56d38562 (diff)
parent4c5c014f51dbe3733e372eb793755b88ac724521 (diff)
downloadboringssl-78c1fb97622551ce548611ecb1cb39425bc5762f.tar.gz
Explicitly call BORINGSSL_self_test() in boringssl_self_test. am: df1a1e826f am: 4c5c014f51
Original change: https://googleplex-android-review.googlesource.com/c/platform/external/boringssl/+/18375513 Change-Id: I4c36c94fee0cbfa954f0be58cd13737455e37464 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r--selftest/boringssl_self_test.cpp14
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
}