[automerger skipped] DO NOT MERGE - Merge Android 13 am: 302f60e5f3 -s ours

am skip reason: Merged-In I648a1af9e16787dfcfeefa2b2f2e4a72cac2c6a6 with SHA-1 2d30b890d2 is already in history

Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2186984

Change-Id: I3bae754efa80e9a9b8d8b91095c0576c0ff3f6a9
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/Android.bp b/Android.bp
index 6fb9c6c..1ccfc09 100644
--- a/Android.bp
+++ b/Android.bp
@@ -168,7 +168,7 @@
         "libkeymint_support",
     ],
     whole_static_libs: [
-        "com.android.sysprop.apex",
+        "libcom.android.sysprop.apex",
         "libc++fs",
     ],
 }
diff --git a/KeyBuffer.h b/KeyBuffer.h
index a68311f..4468220 100644
--- a/KeyBuffer.h
+++ b/KeyBuffer.h
@@ -17,32 +17,18 @@
 #ifndef ANDROID_VOLD_KEYBUFFER_H
 #define ANDROID_VOLD_KEYBUFFER_H
 
-#include <cstring>
+#include <string.h>
 #include <memory>
 #include <vector>
 
 namespace android {
 namespace vold {
 
-/**
- * Variant of memset() that should never be optimized away. Borrowed from keymaster code.
- */
-#ifdef __clang__
-#define OPTNONE __attribute__((optnone))
-#else  // not __clang__
-#define OPTNONE __attribute__((optimize("O0")))
-#endif  // not __clang__
-inline OPTNONE void* memset_s(void* s, int c, size_t n) {
-    if (!s) return s;
-    return memset(s, c, n);
-}
-#undef OPTNONE
-
 // Allocator that delegates useful work to standard one but zeroes data before deallocating.
 class ZeroingAllocator : public std::allocator<char> {
   public:
     void deallocate(pointer p, size_type n) {
-        memset_s(p, 0, n);
+        memset_explicit(p, 0, n);
         std::allocator<char>::deallocate(p, n);
     }
 };
diff --git a/Keystore.cpp b/Keystore.cpp
index d993b0d..6040f2d 100644
--- a/Keystore.cpp
+++ b/Keystore.cpp
@@ -48,7 +48,7 @@
 }
 
 static void zeroize_vector(std::vector<uint8_t>& vec) {
-    memset_s(vec.data(), 0, vec.size());
+    memset_explicit(vec.data(), 0, vec.size());
 }
 
 static bool logKeystore2ExceptionIfPresent(::ndk::ScopedAStatus& rc, const std::string& func_name) {