Add support for 32bit break tests on Android.

Change-Id: I6fa4a146756e22fbae4b057613188f90b6db5d7a
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/63465
Reviewed-by: Adam Langley <agl@google.com>
Auto-Submit: Pete Bentley <prb@google.com>
Commit-Queue: Adam Langley <agl@google.com>
diff --git a/util/fipstools/break-tests.sh b/util/fipstools/break-tests.sh
index 44ca230..736d066 100644
--- a/util/fipstools/break-tests.sh
+++ b/util/fipstools/break-tests.sh
@@ -46,20 +46,24 @@
   fi
 }
 
+MODE=`inferred_mode`
 # Prefer mode from command line if present.
-case "$1" in
-  local|device)
-    MODE=$1
-    ;;
+while [ "$1" ]; do
+  case "$1" in
+    local|device)
+      MODE=$1
+      ;;
 
-  "")
-    MODE=`inferred_mode`
-    ;;
+    "32")
+      TEST32BIT="true"
+      ;;
 
-  *)
-    usage
-    ;;
-esac
+    *)
+      usage
+      ;;
+  esac
+  shift
+done
 
 check_directory() {
   test -d "$1" || die "Directory $1 not found."
@@ -145,10 +149,16 @@
   test "$ANDROID_BUILD_TOP" || die "'lunch aosp_arm64-eng' first"
   check_directory "$ANDROID_PRODUCT_OUT"
 
-  TEST_FIPS_BIN="$ANDROID_PRODUCT_OUT/system/bin/test_fips"
+  if [ "$TEST32BIT" ]; then
+    TEST_FIPS_BIN="$ANDROID_PRODUCT_OUT/system/bin/test_fips32"
+    LIBCRYPTO_BIN="$ANDROID_PRODUCT_OUT/system/lib/libcrypto.so"
+    LIBCRYPTO_BREAK_BIN="$ANDROID_PRODUCT_OUT/system/lib/libcrypto_for_testing.so"
+  else
+    TEST_FIPS_BIN="$ANDROID_PRODUCT_OUT/system/bin/test_fips"
+    LIBCRYPTO_BIN="$ANDROID_PRODUCT_OUT/system/lib64/libcrypto.so"
+    LIBCRYPTO_BREAK_BIN="$ANDROID_PRODUCT_OUT/system/lib64/libcrypto_for_testing.so"
+  fi
   check_file "$TEST_FIPS_BIN"
-  LIBCRYPTO_BIN="$ANDROID_PRODUCT_OUT/system/lib64/libcrypto.so"
-  LIBCRYPTO_BREAK_BIN="$ANDROID_PRODUCT_OUT/system/lib64/libcrypto_for_testing.so"
   check_file "$LIBCRYPTO_BIN"
   check_file "$LIBCRYPTO_BREAK_BIN"