diff --git a/common.mk b/common.mk index c175419..3e06291 100644 --- a/common.mk +++ b/common.mk @@ -216,9 +216,13 @@ PRODUCT_COPY_FILES += \ # Keymaster PRODUCT_PACKAGES += \ android.hardware.keymaster@4.0-service.samsung \ - libcrypto-v33 \ libkeymaster4_1support.vendor +PRODUCT_PACKAGES += \ + libcrypto-v33 \ + libshim_crypto:64 \ + libssl-v33 + # LiveDisplay PRODUCT_PACKAGES += \ vendor.lineage.livedisplay@2.0-service.samsung-qcom.sm7125 diff --git a/extract-files.sh b/extract-files.sh index ea41239..4567211 100755 --- a/extract-files.sh +++ b/extract-files.sh @@ -73,6 +73,8 @@ function blob_fixup() { ;; vendor/lib*/libskeymaster4device.so) "${PATCHELF}" --replace-needed libcrypto.so libcrypto-v33.so "${2}" + "${PATCHELF}" --add-needed libssl-v33.so "${2}" + "${PATCHELF}" --add-needed libshim_crypto.so "${2}" ;; vendor/lib*/hw/gatekeeper.mdfpp.so) "${PATCHELF}" --replace-needed libcrypto.so libcrypto-v33.so "${2}" diff --git a/proprietary-files.txt b/proprietary-files.txt index db124b6..6a257e7 100644 --- a/proprietary-files.txt +++ b/proprietary-files.txt @@ -737,7 +737,7 @@ vendor/firmware/ipa_fws.mdt # Keymaster vendor/lib64/libkeymaster_helper.so --vendor/lib64/libskeymaster4device.so|e4dcee6306be79bb3ca271466afeabd1b0b966d5 +-vendor/lib64/libskeymaster4device.so|bc98d0220e22831a46c9229b0da218876627c3c3 # Machine learning vendor/lib64/libreffeature.so diff --git a/shims/libcrypto/Android.bp b/shims/libcrypto/Android.bp new file mode 100644 index 0000000..39f14e9 --- /dev/null +++ b/shims/libcrypto/Android.bp @@ -0,0 +1,22 @@ +// +// Copyright (C) 2023-2024 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_library_shared { + name: "libshim_crypto", + srcs: ["crypto.c"], + compile_multilib: "64", + shared_libs: ["libcrypto-v33"], + vendor: true, +} diff --git a/shims/libcrypto/crypto.c b/shims/libcrypto/crypto.c new file mode 100644 index 0000000..2c143c5 --- /dev/null +++ b/shims/libcrypto/crypto.c @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2024 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. + */ + +#include + +extern void *sk_new_null(void); +void *OPENSSL_sk_new_null(void) { + return sk_new_null(); +} + +extern size_t sk_num(void *sk); +size_t OPENSSL_sk_num(void *sk) { + return sk_num(sk); +} + +extern size_t sk_push(void *sk, void *p); +size_t OPENSSL_sk_push(void *sk, void *p) { + return sk_push(sk, p); +} + +extern void *sk_value(const void *sk, size_t i); +void* OPENSSL_sk_value(const void *sk, size_t i) { + return sk_value(sk, i); +} diff --git a/vndk/Android.bp b/vndk/Android.bp index e7ca6a3..7577665 100644 --- a/vndk/Android.bp +++ b/vndk/Android.bp @@ -1,5 +1,5 @@ // -// Copyright (C) 2023 The LineageOS Project +// Copyright (C) 2023-2024 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. @@ -25,3 +25,15 @@ cc_prebuilt_library_shared { check_elf_files: false, vendor: true, } + +cc_prebuilt_library_shared { + name: "libssl-v33", + target: { + android_arm64: { + srcs: ["libssl-v33.so"], + }, + }, + compile_multilib: "64", + check_elf_files: false, + vendor: true, +} diff --git a/vndk/libssl-v33.so b/vndk/libssl-v33.so new file mode 120000 index 0000000..05cee97 --- /dev/null +++ b/vndk/libssl-v33.so @@ -0,0 +1 @@ +../../../../prebuilts/vndk/v33/arm64/arch-arm64-armv8-a/shared/vndk-core/libssl.so \ No newline at end of file