[Replicant] [libsamsung-ril] [PATCH] scripts: guix.scm: switch from OpenSSL to LibreSSL

Denis 'GNUtoo' Carikli GNUtoo at cyberdimension.org
Tue Oct 8 15:56:12 UTC 2024


Without that fix, it links against OpenSSL 3.0 which deprecated
MD5_Init, MD5_Update and MD5_Final. And so we end up with these
warnings:
    samsung-ipc/rfs.c: In function ‘ipc_nv_data_md5_calculate’:
    samsung-ipc/rfs.c:75:9: error: ‘MD5_Init’ is deprecated:
    Since OpenSSL 3.0 [-Werror=deprecated-declarations]
       75 |         MD5_Init(&ctx);
          |         ^~~~~~~~

    samsung-ipc/rfs.c:76:9: error: ‘MD5_Update’ is deprecated:
    Since OpenSSL 3.0 [-Werror=deprecated-declarations]
   76 |         MD5_Update(&ctx, data, size);
      |         ^~~~~~~~~~

    samsung-ipc/rfs.c:77:9: error: ‘MD5_Update’ is deprecated:
    Since OpenSSL 3.0 [-Werror=deprecated-declarations]
       77 |         MD5_Update(&ctx, secret, strlen(secret));
          |         ^~~~~~~~~~
          |                           ^~~~~~~~~~

    samsung-ipc/rfs.c:78:9: error: ‘MD5_Final’ is deprecated
    Since OpenSSL 3.0 [-Werror=deprecated-declarations]
       78 |         MD5_Final((unsigned char *) &md5_hash, &ctx);
          |         ^~~~~~~~~

but since we use -Werror the build fails.

If we simply update libsamsung-ril to use the newer OpenSSL API, then
it will not compile anymore on older Android versions.

So to update libsamsung-ril we would need to be compatible with both
older and newer OpenSSL APIs, and that requires a bit more work.

So if we don't want to do that work now, we need a drop-in replacement
package that implements the old OpenSSL API.

Since OpenSSL 1.1.1 is now out of support[1], so it is not a valid
option.

[1]https://www.openssl.org/source/

Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo at cyberdimension.org>
---
 scripts/guix.scm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/guix.scm b/scripts/guix.scm
index 9bc117e..69e555f 100644
--- a/scripts/guix.scm
+++ b/scripts/guix.scm
@@ -100,7 +100,7 @@
    (build-system android-ndk-build-system)
    (inputs
     `(("android-libutils" ,android-libutils)
-      ("libcrypto" ,openssl)))
+      ("libcrypto" ,libressl)))
    (arguments
     `(#:phases
       (modify-phases
@@ -249,7 +249,7 @@
       ("android-liblog" ,android-liblog)
       ("android-libutils" ,android-libutils)
       ("clang" ,clang)
-      ("libcrypto" ,openssl)
+      ("libcrypto" ,libressl)
       ("libsamsung-ipc" ,libsamsung-ipc)
       ("replicant-6-libhardware_legacy" ,replicant-6-libhardware_legacy)))
    (native-inputs
-- 
2.34.1



More information about the Replicant mailing list