From 77e9b721893925da34ee54a02c83924e3f3a623f Mon Sep 17 00:00:00 2001 From: Tim Zimmermann Date: Sun, 23 Jul 2023 20:31:14 +0200 Subject: [PATCH] sm7125-common: Use libcrypto from VNDK33 for keymaster and gatekeeper * Google broke asn1 structs in https://github.com/google/boringssl/commit/9211b80f1e4d66982b17134b61f11db1b8a8a192 by changing types from long to int making the struct used by the blob mismatch new libcrypto Change-Id: I8b110e9841bd9b50ea482aa98c0963567a69f6fc --- common.mk | 1 + extract-files.sh | 6 ++++++ vndk/Android.bp | 27 +++++++++++++++++++++++++++ vndk/libcrypto-v33.so | 1 + 4 files changed, 35 insertions(+) create mode 100644 vndk/Android.bp create mode 120000 vndk/libcrypto-v33.so diff --git a/common.mk b/common.mk index adf49e2..f9e5f9d 100644 --- a/common.mk +++ b/common.mk @@ -225,6 +225,7 @@ PRODUCT_COPY_FILES += \ # Keymaster PRODUCT_PACKAGES += \ android.hardware.keymaster@4.0-service.samsung \ + libcrypto-v33 \ libkeymaster4_1support.vendor # Media diff --git a/extract-files.sh b/extract-files.sh index 1fe6a80..cf1b5b5 100755 --- a/extract-files.sh +++ b/extract-files.sh @@ -70,6 +70,12 @@ function blob_fixup() { # Replace libutils with vndk30 libutils "${PATCHELF}" --replace-needed libutils.so libutils-v30.so "${2}" ;; + vendor/lib*/libskeymaster4device.so) + "${PATCHELF}" --replace-needed libcrypto.so libcrypto-v33.so "${2}" + ;; + vendor/lib*/hw/gatekeeper.mdfpp.so) + "${PATCHELF}" --replace-needed libcrypto.so libcrypto-v33.so "${2}" + ;; esac } diff --git a/vndk/Android.bp b/vndk/Android.bp new file mode 100644 index 0000000..e7ca6a3 --- /dev/null +++ b/vndk/Android.bp @@ -0,0 +1,27 @@ +// +// Copyright (C) 2023 The LineageOS Project +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +cc_prebuilt_library_shared { + name: "libcrypto-v33", + target: { + android_arm64: { + srcs: ["libcrypto-v33.so"], + }, + }, + compile_multilib: "64", + check_elf_files: false, + vendor: true, +} diff --git a/vndk/libcrypto-v33.so b/vndk/libcrypto-v33.so new file mode 120000 index 0000000..9f8a0be --- /dev/null +++ b/vndk/libcrypto-v33.so @@ -0,0 +1 @@ +../../../../prebuilts/vndk/v33/arm64/arch-arm64-armv8-a/shared/vndk-core/libcrypto.so \ No newline at end of file