summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSzuWei Lin <szuweilin@google.com>2022-05-16 16:24:25 +0800
committerSzuWei Lin <szuweilin@google.com>2022-05-16 16:24:25 +0800
commit565bf61da99e05b08dfaf6c9e915afcb6740e344 (patch)
treedab6e1dafcbcb1efe9b7fe5c6db822158a35b8e9
parentcdf1f4bf6b34b37dc5c7d38241ccc6efc4e94ae3 (diff)
parent895340593c6147d91be670961489275189a02e13 (diff)
downloadboringssl-565bf61da99e05b08dfaf6c9e915afcb6740e344.tar.gz
Merge branch tm-release
Change-Id: Ia5b36255b8ef8aac224d24396a5ccf1e09f3c708
-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
}